net config

This commit is contained in:
Harivansh Rathi 2026-02-04 15:18:34 -05:00
parent 93b7b93d64
commit dd59a54b92
36 changed files with 960 additions and 631 deletions

View file

@ -1,26 +0,0 @@
---@type ChadrcConfig
local M = {}
M.base46 = {
theme = "gruvbox", -- NvChad's gruvbox theme
transparency = false, -- Keep your transparent mode
-- theme_toggle = { "gruvbox", "gruvbox_light" },
}
M.ui = {
statusline = {
enabled = true,
theme = "default", -- options: default, vscode, vscode_colored, minimal
separator_style = "round", -- default, round, block, arrow
},
tabufline = {
enabled = false,
},
}
-- Disable nvdash if you want to keep your dashboard.lua
M.nvdash = {
load_on_startup = false,
}
return M

41
lua/config/lsp.lua Normal file
View file

@ -0,0 +1,41 @@
-- Shared LSP utilities
local M = {}
-- Set up buffer-local keymaps when LSP attaches
function M.on_attach(client, bufnr)
local opts = { buffer = bufnr, silent = true }
-- Navigation
vim.keymap.set("n", "gd", vim.lsp.buf.definition, vim.tbl_extend("force", opts, { desc = "Go to definition" }))
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, vim.tbl_extend("force", opts, { desc = "Go to declaration" }))
vim.keymap.set("n", "<C-]>", vim.lsp.buf.definition, vim.tbl_extend("force", opts, { desc = "Go to definition" }))
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, vim.tbl_extend("force", opts, { desc = "Go to implementation" }))
vim.keymap.set("n", "gr", vim.lsp.buf.references, vim.tbl_extend("force", opts, { desc = "Go to references" }))
-- Documentation
vim.keymap.set("n", "K", vim.lsp.buf.hover, vim.tbl_extend("force", opts, { desc = "Hover documentation" }))
-- Refactoring
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, vim.tbl_extend("force", opts, { desc = "Rename symbol" }))
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code action" }))
-- Formatting
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format({ async = true })
end, vim.tbl_extend("force", opts, { desc = "Format buffer" }))
end
-- Return default capabilities for LSP servers
function M.capabilities()
local capabilities = vim.lsp.protocol.make_client_capabilities()
-- If nvim-cmp is available, extend capabilities
local ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if ok then
capabilities = vim.tbl_deep_extend("force", capabilities, cmp_nvim_lsp.default_capabilities())
end
return capabilities
end
return M

139
lua/config/statusline.lua Normal file
View file

@ -0,0 +1,139 @@
-- Minimal custom statusline
local M = {}
-- Mode mapping
local mode_map = {
n = "NORMAL",
no = "N-PENDING",
nov = "N-PENDING",
noV = "N-PENDING",
["no\22"] = "N-PENDING",
niI = "NORMAL",
niR = "NORMAL",
niV = "NORMAL",
nt = "NORMAL",
ntT = "NORMAL",
v = "VISUAL",
vs = "VISUAL",
V = "V-LINE",
Vs = "V-LINE",
["\22"] = "V-BLOCK",
["\22s"] = "V-BLOCK",
s = "SELECT",
S = "S-LINE",
["\19"] = "S-BLOCK",
i = "INSERT",
ic = "INSERT",
ix = "INSERT",
R = "REPLACE",
Rc = "REPLACE",
Rx = "REPLACE",
Rv = "V-REPLACE",
Rvc = "V-REPLACE",
Rvx = "V-REPLACE",
c = "COMMAND",
cv = "EX",
ce = "EX",
r = "REPLACE",
rm = "MORE",
["r?"] = "CONFIRM",
["!"] = "SHELL",
t = "TERMINAL",
}
-- Get current mode indicator
local function get_mode()
local mode = vim.api.nvim_get_mode().mode
return mode_map[mode] or mode
end
-- Get git branch from gitsigns
local function get_git_branch()
local branch = vim.b.gitsigns_head
if branch and branch ~= "" then
return " " .. branch
end
return ""
end
-- Get filename with modified indicator
local function get_filename()
local filename = vim.fn.expand("%:t")
if filename == "" then
filename = "[No Name]"
end
local modified = vim.bo.modified and " [+]" or ""
local readonly = vim.bo.readonly and " [RO]" or ""
return filename .. modified .. readonly
end
-- Get file path (relative to cwd)
local function get_filepath()
local filepath = vim.fn.expand("%:~:.")
if filepath == "" then
return ""
end
return filepath
end
-- Get current position
local function get_position()
local line = vim.fn.line(".")
local col = vim.fn.col(".")
local total = vim.fn.line("$")
return string.format("%d:%d/%d", line, col, total)
end
-- Get filetype
local function get_filetype()
local ft = vim.bo.filetype
if ft == "" then
return ""
end
return ft
end
-- Build the statusline
function M.statusline()
local parts = {}
-- Left side
table.insert(parts, " " .. get_mode() .. " ")
table.insert(parts, get_git_branch())
local filepath = get_filepath()
if filepath ~= "" then
table.insert(parts, " " .. filepath)
end
-- Modified indicator
if vim.bo.modified then
table.insert(parts, " [+]")
end
-- Separator
table.insert(parts, "%=")
-- Right side
local ft = get_filetype()
if ft ~= "" then
table.insert(parts, ft .. " ")
end
table.insert(parts, get_position() .. " ")
return table.concat(parts, "")
end
-- Setup function to configure the statusline
function M.setup()
-- Use the %!v:lua.require() pattern
vim.o.statusline = "%!v:lua.require('config.statusline').statusline()"
-- Ensure statusline is always shown
vim.o.laststatus = 2
end
return M

25
lua/lsp/lua_ls.lua Normal file
View file

@ -0,0 +1,25 @@
-- Lua language server configuration
return {
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
runtime = {
version = "LuaJIT",
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
telemetry = {
enable = false,
},
hint = {
enable = true,
},
},
},
}

13
lua/lsp/pyright.lua Normal file
View file

@ -0,0 +1,13 @@
-- Pyright (Python) language server configuration
return {
settings = {
python = {
analysis = {
typeCheckingMode = "basic",
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "workspace",
},
},
},
}

28
lua/lsp/rust_analyzer.lua Normal file
View file

@ -0,0 +1,28 @@
-- Rust Analyzer configuration with clippy integration
return {
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy",
},
cargo = {
allFeatures = true,
},
procMacro = {
enable = true,
},
diagnostics = {
enable = true,
},
inlayHints = {
bindingModeHints = { enable = true },
chainingHints = { enable = true },
closingBraceHints = { enable = true },
closureReturnTypeHints = { enable = "always" },
lifetimeElisionHints = { enable = "always" },
parameterHints = { enable = true },
typeHints = { enable = true },
},
},
},
}

27
lua/lsp/ts_ls.lua Normal file
View file

@ -0,0 +1,27 @@
-- TypeScript language server configuration
return {
settings = {
typescript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
javascript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
},
}

View file

@ -1,8 +0,0 @@
return {
"otavioschwanck/arrow.nvim",
event = 'VeryLazy',
opts = {
show_icons = true,
leader_key = '-'
}
}

View file

@ -1,7 +0,0 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("nvim-autopairs").setup({})
end,
}

View file

@ -1,14 +0,0 @@
return {
"numToStr/Comment.nvim",
keys = {
{ "gcc", mode = "n", desc = "Comment toggle current line" },
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
{ "gbc", mode = "n", desc = "Comment toggle current block" },
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
},
config = function()
require("Comment").setup()
end,
}

View file

@ -1,76 +0,0 @@
return {
"nvimdev/dashboard-nvim",
event = "VimEnter",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
-- Calculate vertical padding to center the dashboard
local header_art = {
" ██▒ █▓ ██▓ ███▄ ▄███▓",
"▓██░ █▒▓██▒▓██▒▀█▀ ██▒",
" ▓██ █▒░▒██▒▓██ ▓██░",
" ▒██ █░░░██░▒██ ▒██ ",
" ▒▀█░ ░██░▒██▒ ░██▒",
" ░ ▐░ ░▓ ░ ▒░ ░ ░",
" ░ ░░ ▒ ░░ ░ ░",
" ░░ ▒ ░░ ░ ",
" ░ ░ ░ ",
"",
}
local center_items = 6
local content_height = #header_art + 2 + (center_items * 2) -- header + spacing + center items
local win_height = vim.fn.winheight(0)
local padding = math.max(0, math.floor((win_height - content_height) / 2))
local header = {}
for _ = 1, padding do
table.insert(header, "")
end
for _, line in ipairs(header_art) do
table.insert(header, line)
end
table.insert(header, "")
table.insert(header, "")
vim.api.nvim_set_hl(0, "DashboardHeader", { fg = "#83a598" })
require("dashboard").setup({
theme = "doom",
config = {
header = header,
center = {
{
icon = " ",
desc = "Find File ",
key = "f",
action = "Telescope find_files",
},
{
icon = " ",
desc = "Recent Files ",
key = "r",
action = "Telescope oldfiles",
},
{
icon = " ",
desc = "Find Text ",
key = "g",
action = "Telescope live_grep",
},
{
icon = " ",
desc = "File Explorer ",
key = "e",
action = "Neotree toggle",
},
{
icon = " ",
desc = "Quit ",
key = "q",
action = "quit",
},
},
footer = {},
},
})
end,
}

View file

@ -1,10 +0,0 @@
return {
"barrettruth/diffs.nvim",
ft = { "git", "fugitive", "diff" },
opts = {
hide_prefix = true,
highlights = {
gutter = true,
},
},
}

67
lua/plugins/editor.lua Normal file
View file

@ -0,0 +1,67 @@
return {
-- Autopairs
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("nvim-autopairs").setup({})
end,
},
-- Comment.nvim
{
"numToStr/Comment.nvim",
keys = {
{ "gcc", mode = "n", desc = "Comment toggle current line" },
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
{ "gbc", mode = "n", desc = "Comment toggle current block" },
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
},
config = function()
require("Comment").setup()
end,
},
-- Flash.nvim for navigation
{
"folke/flash.nvim",
event = "VeryLazy",
opts = {
modes = {
search = {
enabled = true,
},
},
},
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
},
-- Supermaven AI completion
{
"supermaven-inc/supermaven-nvim",
event = "InsertEnter",
opts = {
keymaps = {
accept_suggestion = "<Tab>",
clear_suggestion = "<C-]>",
accept_word = "<C-j>",
},
ignore_filetypes = { "gitcommit", "TelescopePrompt" },
color = {
suggestion_color = vim.api.nvim_get_hl(0, { name = "Comment" }).fg,
cterm = 244,
},
log_level = "info",
disable_inline_completion = false,
disable_keymaps = false,
},
},
}

View file

@ -1,18 +0,0 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
opts = {
modes = {
search = {
enabled = true,
}
}
},
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
}

View file

@ -1,78 +1,80 @@
return {
-- Neogit: Modern Git interface with tree view
-- Fugitive: The gold standard for Git in Vim
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"sindrets/diffview.nvim", -- optional - Diff integration
"nvim-telescope/telescope.nvim", -- optional
},
config = function()
require('neogit').setup({
-- Neo-tree style integration
kind = "split",
commit_editor = {
kind = "split",
},
popup = {
kind = "split",
},
-- Signs for different git states
signs = {
-- { CLOSED, OPENED }
hunk = { "", "" },
item = { "", "" },
section = { "", "" },
},
-- Integrations
integrations = {
telescope = true,
diffview = true,
},
})
end,
"tpope/vim-fugitive",
cmd = { "Git", "G", "Gread", "Gwrite", "Gdiffsplit", "Gvdiffsplit", "Gblame" },
keys = {
{ "<leader>gg", "<cmd>Neogit<cr>", desc = "Open Neogit" },
{ "<leader>gc", "<cmd>Neogit commit<cr>", desc = "Git Commit" },
{ "<leader>gp", "<cmd>Neogit push<cr>", desc = "Git Push" },
{ "<leader>gl", "<cmd>Neogit pull<cr>", desc = "Git Pull" },
{ "<leader>gg", "<cmd>Git<cr>", desc = "Git status" },
{ "<leader>gc", "<cmd>Git commit<cr>", desc = "Git commit" },
{ "<leader>gp", "<cmd>Git push<cr>", desc = "Git push" },
{ "<leader>gl", "<cmd>Git pull<cr>", desc = "Git pull" },
{ "<leader>gb", "<cmd>Git blame<cr>", desc = "Git blame" },
{ "<leader>gd", "<cmd>Gvdiffsplit<cr>", desc = "Git diff vertical" },
{ "<leader>gr", "<cmd>Gread<cr>", desc = "Git checkout file" },
{ "<leader>gw", "<cmd>Gwrite<cr>", desc = "Git add file" },
},
},
-- Diffview: Enhanced diff viewing
-- Gitsigns: Git info in the gutter
{
"sindrets/diffview.nvim",
cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" },
config = function()
-- Set up diff highlights before loading diffview
vim.api.nvim_set_hl(0, "DiffAdd", { bg = "#2a3a2a" })
vim.api.nvim_set_hl(0, "DiffChange", { bg = "#3a3a2a" })
vim.api.nvim_set_hl(0, "DiffDelete", { bg = "#3a2a2a" })
vim.api.nvim_set_hl(0, "DiffText", { bg = "#5a3d3d" })
require("diffview").setup({
diff_binaries = false, -- Show diffs for binaries
enhanced_diff_hl = true, -- Better word-level diff highlighting
git_cmd = { "git" }, -- The git executable followed by default args.
use_icons = true, -- Requires nvim-web-devicons
show_help_hints = true, -- Show hints for how to open the help panel
watch_index = true, -- Update views and index on git index changes.
})
end,
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "" },
},
signs_staged = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "" },
},
signs_staged_enable = true,
signcolumn = true,
numhl = false,
linehl = false, -- disabled - let colorscheme handle
word_diff = false,
current_line_blame = false,
current_line_blame_opts = {
delay = 500,
},
},
keys = {
{ "<leader>gdo", "<cmd>DiffviewOpen<cr>", desc = "Open Diffview" },
{ "<leader>gdc", "<cmd>DiffviewClose<cr>", desc = "Close Diffview" },
{ "<leader>gdh", "<cmd>DiffviewFileHistory<cr>", desc = "File History" },
{ "]g", "<cmd>Gitsigns next_hunk<cr>", desc = "Next hunk" },
{ "[g", "<cmd>Gitsigns prev_hunk<cr>", desc = "Prev hunk" },
{ "<leader>ghs", "<cmd>Gitsigns stage_hunk<cr>", desc = "Stage hunk" },
{ "<leader>ghr", "<cmd>Gitsigns reset_hunk<cr>", desc = "Reset hunk" },
{ "<leader>ghp", "<cmd>Gitsigns preview_hunk<cr>", desc = "Preview hunk" },
{ "<leader>gB", "<cmd>Gitsigns toggle_current_line_blame<cr>", desc = "Toggle line blame" },
},
},
-- Fugitive: Additional Git commands
-- Snacks: GitHub integration (browse, issues, PRs)
{
'tpope/vim-fugitive',
cmd = { 'Git', 'Gblame', 'Gdiff', 'Gread', 'Gwrite', 'Ggrep' },
"folke/snacks.nvim",
lazy = false,
opts = {
gitbrowse = {},
},
keys = {
{ '<leader>gb', '<cmd>Git blame<cr>', desc = 'Git Blame' },
{ '<leader>gd', '<cmd>Gdiff<cr>', desc = 'Git Diff (Fugitive)' },
}
{ "<leader>go", function() Snacks.gitbrowse() end, desc = "Open in GitHub" },
},
},
-- Diffs.nvim: Better diff highlighting
{
"barrettruth/diffs.nvim",
ft = { "git", "fugitive", "diff" },
opts = {
hide_prefix = true,
highlights = {
gutter = true,
},
},
},
}

View file

@ -1,37 +0,0 @@
return {
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
require("gitsigns").setup({
signcolumn = true,
numhl = false,
linehl = true,
word_diff = false,
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
signs_staged = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
signs_staged_enable = true,
on_attach = function(bufnr)
-- Unstaged changes - line highlighting
vim.api.nvim_set_hl(0, "GitSignsAddLn", { bg = "#2a3a2a" })
vim.api.nvim_set_hl(0, "GitSignsChangeLn", { bg = "#3a3a2a" })
vim.api.nvim_set_hl(0, "GitSignsDeleteLn", { bg = "#3a2a2a" })
-- Staged changes - NO line highlighting (gutter only)
vim.api.nvim_set_hl(0, "GitSignsStagedAddLn", {})
vim.api.nvim_set_hl(0, "GitSignsStagedChangeLn", {})
vim.api.nvim_set_hl(0, "GitSignsStagedDeleteLn", {})
end,
})
end,
}

View file

@ -1,89 +1,66 @@
return {
{
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls", -- Lua
"pyright", -- Python
"ts_ls", -- TypeScript/JavaScript (tsserver renamed)
"rust_analyzer", -- Rust
"gopls", -- Go
"clangd", -- C/C++
"bashls", -- Bash
"jsonls", -- JSON
"yamlls", -- YAML
"html", -- HTML
"cssls", -- CSS
{
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
automatic_installation = true,
})
config = function()
local lsp_config = require("config.lsp")
local lspconfig = require("lspconfig")
local capabilities = vim.lsp.protocol.make_client_capabilities()
-- Basic LSP keymaps
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
local opts = { buffer = ev.buf }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "<C-]>", vim.lsp.buf.definition, opts) -- Ctrl+] for go to definition
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format({ async = true })
end, opts)
end,
})
-- Auto-setup all installed servers
require("mason-lspconfig").setup_handlers({
-- Default handler for all servers
function(server_name)
lspconfig[server_name].setup({
capabilities = capabilities,
})
end,
-- Custom configuration for specific servers
["lua_ls"] = function()
lspconfig.lua_ls.setup({
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
-- Set up Mason for auto-installation
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"pyright",
"ts_ls",
"rust_analyzer",
"gopls",
"clangd",
"bashls",
"jsonls",
"html",
"cssls",
},
},
},
})
end,
automatic_installation = true,
})
["pyright"] = function()
lspconfig.pyright.setup({
capabilities = capabilities,
settings = {
python = {
analysis = {
typeCheckingMode = "basic",
autoSearchPaths = true,
useLibraryCodeForTypes = true,
},
},
},
})
local lspconfig = require("lspconfig")
local capabilities = lsp_config.capabilities()
-- LspAttach autocmd for keymaps
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client then
lsp_config.on_attach(client, ev.buf)
end
end,
})
-- Helper to load per-server config from lua/lsp/ if it exists
local function get_server_config(server_name)
local ok, server_config = pcall(require, "lsp." .. server_name)
if ok then
return server_config
end
return {}
end
-- Auto-setup all installed servers
require("mason-lspconfig").setup_handlers({
-- Default handler for all servers
function(server_name)
local server_config = get_server_config(server_name)
local config = vim.tbl_deep_extend("force", {
capabilities = capabilities,
}, server_config)
lspconfig[server_name].setup(config)
end,
})
end,
})
end,
},
}
},
}

142
lua/plugins/navigation.lua Normal file
View file

@ -0,0 +1,142 @@
return {
-- Telescope fuzzy finder
{
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
},
cmd = "Telescope",
keys = {
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" },
{
"<leader>fs",
function()
require("telescope.builtin").find_files({
find_command = {
"fd",
"--type", "f",
"--max-depth", "3",
"--strip-cwd-prefix",
"--hidden",
"--exclude", ".git",
"--exclude", "node_modules",
"--exclude", ".next",
},
})
end,
desc = "Shallow find files",
},
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" },
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
{ "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" },
},
config = function()
local telescope = require("telescope")
telescope.setup({
defaults = {
file_ignore_patterns = {
"node_modules",
".next",
".git",
"dist",
"build",
"%.lock",
},
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--hidden",
"--glob=!.git/",
"--glob=!node_modules/",
"--glob=!.next/",
},
mappings = {
i = {
["<C-j>"] = "move_selection_next",
["<C-k>"] = "move_selection_previous",
},
},
},
pickers = {
find_files = {
hidden = true,
find_command = {
"fd",
"--type", "f",
"--strip-cwd-prefix",
"--hidden",
"--exclude", ".git",
"--exclude", "node_modules",
"--exclude", ".next",
},
},
},
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
})
telescope.load_extension("fzf")
end,
},
-- Oil file explorer
{
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
lazy = false,
keys = {
{ "-", "<cmd>Oil<cr>", desc = "Open parent directory" },
},
opts = {
default_file_explorer = true,
columns = {
"icon",
},
view_options = {
show_hidden = true,
},
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-v>"] = "actions.select_vsplit",
["<C-s>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-r>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["gs"] = "actions.change_sort",
["gx"] = "actions.open_external",
["g."] = "actions.toggle_hidden",
},
},
},
-- Arrow for quick file bookmarks
{
"otavioschwanck/arrow.nvim",
event = "VeryLazy",
opts = {
show_icons = true,
leader_key = ";",
},
},
}

View file

@ -1,50 +0,0 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
cmd = "Neotree",
keys = {
{ "<leader>e", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
{ "<BS>", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
{ "<leader>gs", "<cmd>Neotree git_status left<cr>", desc = "Focus git status" },
},
config = function()
require("neo-tree").setup({
close_if_last_window = true,
window = {
width = 30,
},
-- Source selector (tabs) to switch between files/git
source_selector = {
winbar = true,
content_layout = "center",
tabs_layout = "equal",
sources = {
{ source = "filesystem", display_name = " Files" },
{ source = "git_status", display_name = " Git" },
},
},
filesystem = {
follow_current_file = {
enabled = true, -- Highlight and auto-expand to current file
leave_dirs_open = false, -- Close dirs when navigating away
},
filtered_items = {
visible = true, -- Show filtered items (hidden files)
hide_dotfiles = false, -- Show dotfiles
hide_gitignored = false, -- Show git ignored files
hide_hidden = false, -- Show hidden files on Windows
},
},
git_status = {
follow_current_file = {
enabled = true,
},
},
})
end,
}

View file

@ -1,31 +0,0 @@
return {
"nvim-lua/plenary.nvim",
{
"nvchad/base46",
lazy = false,
priority = 1000,
build = function()
require("base46").load_all_highlights()
end,
config = function()
-- Generate cache on first load if it doesn't exist
local cache_path = vim.g.base46_cache
if not vim.uv.fs_stat(cache_path) then
vim.fn.mkdir(cache_path, "p")
require("base46").load_all_highlights()
end
end,
},
{
"nvchad/ui",
lazy = false,
priority = 999,
config = function()
require("nvchad")
end,
},
}

View file

@ -1,34 +0,0 @@
return {
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
lazy = false,
keys = {
{ "-", "<cmd>Oil<cr>", desc = "Open parent directory" },
},
opts = {
default_file_explorer = true,
columns = {
"icon",
},
view_options = {
show_hidden = true,
},
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-v>"] = "actions.select_vsplit",
["<C-s>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-r>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["gs"] = "actions.change_sort",
["gx"] = "actions.open_external",
["g."] = "actions.toggle_hidden",
},
},
}

View file

@ -1,19 +0,0 @@
return {
"supermaven-inc/supermaven-nvim",
event = "InsertEnter",
opts = {
keymaps = {
accept_suggestion = "<Tab>",
clear_suggestion = "<C-]>",
accept_word = "<C-j>",
},
ignore_filetypes = { "gitcommit", "TelescopePrompt" },
color = {
suggestion_color = "#808080",
cterm = 244,
},
log_level = "info",
disable_inline_completion = false,
disable_keymaps = false,
},
}

View file

@ -1,56 +0,0 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
dependencies = { "nvim-lua/plenary.nvim" },
cmd = "Telescope",
keys = {
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" },
{ "<leader>fs", function()
require("telescope.builtin").find_files({
find_command = { "fd", "--type", "f", "--max-depth", "3", "--strip-cwd-prefix", "--hidden", "--exclude", ".git", "--exclude", "node_modules", "--exclude", ".next" }
})
end, desc = "Shallow find files" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" },
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
{ "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" },
},
config = function()
require("telescope").setup({
defaults = {
file_ignore_patterns = {
"node_modules",
".next",
".git",
"dist",
"build",
"%.lock",
},
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--hidden",
"--glob=!.git/",
"--glob=!node_modules/",
"--glob=!.next/",
},
mappings = {
i = {
["<C-j>"] = "move_selection_next",
["<C-k>"] = "move_selection_previous",
},
},
},
pickers = {
find_files = {
hidden = true,
find_command = { "fd", "--type", "f", "--strip-cwd-prefix", "--hidden", "--exclude", ".git", "--exclude", "node_modules", "--exclude", ".next" },
},
},
})
end,
}

View file

@ -1,17 +1,92 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "lua", "vim", "vimdoc", "query", "javascript", "typescript", "python", "html", "css", "json", "yaml", "markdown" },
auto_install = true,
highlight = {
enable = false,
},
indent = {
enable = true,
},
})
end,
-- Treesitter for syntax highlighting and code understanding
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"lua",
"vim",
"vimdoc",
"query",
"javascript",
"typescript",
"tsx",
"python",
"html",
"css",
"json",
"yaml",
"markdown",
"markdown_inline",
"bash",
"regex",
},
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["ai"] = "@conditional.outer",
["ii"] = "@conditional.inner",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["ab"] = "@block.outer",
["ib"] = "@block.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]f"] = "@function.outer",
["]c"] = "@class.outer",
["]a"] = "@parameter.inner",
},
goto_next_end = {
["]F"] = "@function.outer",
["]C"] = "@class.outer",
},
goto_previous_start = {
["[f"] = "@function.outer",
["[c"] = "@class.outer",
["[a"] = "@parameter.inner",
},
goto_previous_end = {
["[F"] = "@function.outer",
["[C"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>sn"] = "@parameter.inner",
},
swap_previous = {
["<leader>sp"] = "@parameter.inner",
},
},
},
})
end,
},
}

113
lua/plugins/ui.lua Normal file
View file

@ -0,0 +1,113 @@
return {
-- Gruvbox Material colorscheme
{
"sainnhe/gruvbox-material",
lazy = false,
priority = 1000,
config = function()
vim.g.gruvbox_material_background = "medium"
vim.g.gruvbox_material_foreground = "material"
vim.g.gruvbox_material_enable_italic = true
vim.g.gruvbox_material_enable_bold = true
vim.g.gruvbox_material_better_performance = true
vim.g.gruvbox_material_diagnostic_text_highlight = true
vim.g.gruvbox_material_diagnostic_virtual_text = "colored"
vim.cmd.colorscheme("gruvbox-material")
end,
},
-- Dashboard
{
"nvimdev/dashboard-nvim",
event = "VimEnter",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local header_art = {
" ██▒ █▓ ██▓ ███▄ ▄███▓",
"▓██░ █▒▓██▒▓██▒▀█▀ ██▒",
" ▓██ █▒░▒██▒▓██ ▓██░",
" ▒██ █░░░██░▒██ ▒██ ",
" ▒▀█░ ░██░▒██▒ ░██▒",
" ░ ▐░ ░▓ ░ ▒░ ░ ░",
" ░ ░░ ▒ ░░ ░ ░",
" ░░ ▒ ░░ ░ ",
" ░ ░ ░ ",
"",
}
local center_items = 6
local content_height = #header_art + 2 + (center_items * 2)
local win_height = vim.fn.winheight(0)
local padding = math.max(0, math.floor((win_height - content_height) / 2))
local header = {}
for _ = 1, padding do
table.insert(header, "")
end
for _, line in ipairs(header_art) do
table.insert(header, line)
end
table.insert(header, "")
table.insert(header, "")
require("dashboard").setup({
theme = "doom",
config = {
header = header,
center = {
{
icon = " ",
desc = "Find File ",
key = "f",
action = "Telescope find_files",
},
{
icon = " ",
desc = "Recent Files ",
key = "r",
action = "Telescope oldfiles",
},
{
icon = " ",
desc = "Find Text ",
key = "g",
action = "Telescope live_grep",
},
{
icon = " ",
desc = "File Explorer ",
key = "e",
action = "Oil",
},
{
icon = " ",
desc = "Quit ",
key = "q",
action = "quit",
},
},
footer = {},
},
})
end,
},
-- Which-key for keybinding hints
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
win = {
border = { "", "", "", "", "", "", "", "" },
},
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
},
}

View file

@ -1,18 +0,0 @@
return {
"folke/which-key.nvim",
event = 'VeryLazy',
opts = {
win = {
border = { "", "", "", "", "","", "", "" },
},
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}