diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8cd59ea --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "nvim/.config/nvim"] + path = nvim/.config/nvim + url = https://github.com/harivansh-afk/nvim.git diff --git a/nvim/.config/nvim b/nvim/.config/nvim new file mode 160000 index 0000000..861c569 --- /dev/null +++ b/nvim/.config/nvim @@ -0,0 +1 @@ +Subproject commit 861c56911077b076b9cafdbff4f250f98e80c2f8 diff --git a/nvim/.config/nvim/after/ftplugin/fugitive.lua b/nvim/.config/nvim/after/ftplugin/fugitive.lua deleted file mode 100644 index 06af016..0000000 --- a/nvim/.config/nvim/after/ftplugin/fugitive.lua +++ /dev/null @@ -1 +0,0 @@ -vim.keymap.set("n", "", "=", { buffer = true, remap = true }) diff --git a/nvim/.config/nvim/after/ftplugin/go.lua b/nvim/.config/nvim/after/ftplugin/go.lua deleted file mode 100644 index 345d732..0000000 --- a/nvim/.config/nvim/after/ftplugin/go.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.opt_local.expandtab = false -vim.opt_local.tabstop = 4 diff --git a/nvim/.config/nvim/after/ftplugin/lua.lua b/nvim/.config/nvim/after/ftplugin/lua.lua deleted file mode 100644 index 3aec42b..0000000 --- a/nvim/.config/nvim/after/ftplugin/lua.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.opt_local.tabstop = 4 -vim.opt_local.shiftwidth = 4 diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua deleted file mode 100644 index ca04c23..0000000 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.opt_local.wrap = true -vim.opt_local.textwidth = 80 -vim.opt_local.conceallevel = 2 diff --git a/nvim/.config/nvim/after/ftplugin/python.lua b/nvim/.config/nvim/after/ftplugin/python.lua deleted file mode 100644 index e499672..0000000 --- a/nvim/.config/nvim/after/ftplugin/python.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.opt_local.makeprg = "python %" -vim.opt_local.colorcolumn = "88" diff --git a/nvim/.config/nvim/after/ftplugin/rust.lua b/nvim/.config/nvim/after/ftplugin/rust.lua deleted file mode 100644 index 187581e..0000000 --- a/nvim/.config/nvim/after/ftplugin/rust.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.opt_local.makeprg = "cargo run" -vim.opt_local.colorcolumn = "100" diff --git a/nvim/.config/nvim/after/plugin/lsp.lua b/nvim/.config/nvim/after/plugin/lsp.lua deleted file mode 100644 index 2ecfa1e..0000000 --- a/nvim/.config/nvim/after/plugin/lsp.lua +++ /dev/null @@ -1,34 +0,0 @@ -local lsp_config = require("config.lsp") - -vim.lsp.config("*", { - capabilities = lsp_config.capabilities(), -}) - -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, -}) - -for _, server in ipairs({ - "lua_ls", - "pyright", - "ts_ls", - "rust_analyzer", - "gopls", - "clangd", - "bashls", - "jsonls", - "html", - "cssls", -}) do - local ok, config = pcall(require, "lsp." .. server) - if ok then - vim.lsp.config(server, config) - end - vim.lsp.enable(server) -end diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua deleted file mode 100644 index 55a8823..0000000 --- a/nvim/.config/nvim/init.lua +++ /dev/null @@ -1,50 +0,0 @@ --- Set leader keys before lazy -vim.g.mapleader = " " -vim.g.maplocalleader = "," - --- Global mapping helpers -_G.map = function(mode, lhs, rhs, opts) - opts = opts or {} - opts.silent = opts.silent ~= false - vim.keymap.set(mode, lhs, rhs, opts) -end - -_G.bmap = function(buf, mode, lhs, rhs, opts) - opts = opts or {} - opts.buffer = buf - opts.silent = opts.silent ~= false - vim.keymap.set(mode, lhs, rhs, opts) -end - --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.uv.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - --- Load plugins -require("lazy").setup("plugins", { - defaults = { lazy = true }, - performance = { - rtp = { - disabled_plugins = { - "gzip", - "matchit", - "matchparen", - "netrwPlugin", - "tarPlugin", - "tohtml", - "zipPlugin", - }, - }, - }, -}) - diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json deleted file mode 100644 index 1f1a1de..0000000 --- a/nvim/.config/nvim/lazy-lock.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" }, - "diffs.nvim": { "branch": "main", "commit": "3d640c207bf21c671bac717a532e2ff9b5cf91d9" }, - "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, - "fzf-lua": { "branch": "main", "commit": "5921997472574fca3880b62949eb8679dc6f5afc" }, - "gitsigns.nvim": { "branch": "main", "commit": "9f3c6dd7868bcc116e9c1c1929ce063b978fa519" }, - "gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21c2a84ce368e99b18f52ab348c4c02c32c02fcf" }, - "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, - "nvim-lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-textobjects": { "branch": "main", "commit": "a0e182ae21fda68c59d1f36c9ed45600aef50311" }, - "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, - "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, - "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, - "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, - "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } -} diff --git a/nvim/.config/nvim/lua/config/lsp.lua b/nvim/.config/nvim/lua/config/lsp.lua deleted file mode 100644 index 5775f79..0000000 --- a/nvim/.config/nvim/lua/config/lsp.lua +++ /dev/null @@ -1,41 +0,0 @@ --- 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", "", 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", "rn", vim.lsp.buf.rename, vim.tbl_extend("force", opts, { desc = "Rename symbol" })) - vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code action" })) - - -- Formatting - vim.keymap.set("n", "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 diff --git a/nvim/.config/nvim/lua/config/statusline.lua b/nvim/.config/nvim/lua/config/statusline.lua deleted file mode 100644 index 1a13703..0000000 --- a/nvim/.config/nvim/lua/config/statusline.lua +++ /dev/null @@ -1,139 +0,0 @@ --- 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 diff --git a/nvim/.config/nvim/lua/lsp/lua_ls.lua b/nvim/.config/nvim/lua/lsp/lua_ls.lua deleted file mode 100644 index 20d356f..0000000 --- a/nvim/.config/nvim/lua/lsp/lua_ls.lua +++ /dev/null @@ -1,25 +0,0 @@ --- 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, - }, - }, - }, -} diff --git a/nvim/.config/nvim/lua/lsp/pyright.lua b/nvim/.config/nvim/lua/lsp/pyright.lua deleted file mode 100644 index 4916d5a..0000000 --- a/nvim/.config/nvim/lua/lsp/pyright.lua +++ /dev/null @@ -1,13 +0,0 @@ --- Pyright (Python) language server configuration -return { - settings = { - python = { - analysis = { - typeCheckingMode = "basic", - autoSearchPaths = true, - useLibraryCodeForTypes = true, - diagnosticMode = "workspace", - }, - }, - }, -} diff --git a/nvim/.config/nvim/lua/lsp/rust_analyzer.lua b/nvim/.config/nvim/lua/lsp/rust_analyzer.lua deleted file mode 100644 index e263d50..0000000 --- a/nvim/.config/nvim/lua/lsp/rust_analyzer.lua +++ /dev/null @@ -1,28 +0,0 @@ --- 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 }, - }, - }, - }, -} diff --git a/nvim/.config/nvim/lua/lsp/ts_ls.lua b/nvim/.config/nvim/lua/lsp/ts_ls.lua deleted file mode 100644 index c24e861..0000000 --- a/nvim/.config/nvim/lua/lsp/ts_ls.lua +++ /dev/null @@ -1,27 +0,0 @@ --- 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, - }, - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/editor.lua b/nvim/.config/nvim/lua/plugins/editor.lua deleted file mode 100644 index 37d18b2..0000000 --- a/nvim/.config/nvim/lua/plugins/editor.lua +++ /dev/null @@ -1,67 +0,0 @@ -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" }, - { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, - }, - }, - - -- Supermaven AI completion - { - "supermaven-inc/supermaven-nvim", - event = "InsertEnter", - opts = { - keymaps = { - accept_suggestion = "", - clear_suggestion = "", - accept_word = "", - }, - 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, - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/fzf.lua b/nvim/.config/nvim/lua/plugins/fzf.lua deleted file mode 100644 index eb00fb1..0000000 --- a/nvim/.config/nvim/lua/plugins/fzf.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - "ibhagwan/fzf-lua", - dependencies = { "nvim-tree/nvim-web-devicons" }, - cmd = "FzfLua", - keys = { - -- Main keybinds - { - "", - function() - local fzf = require("fzf-lua") - local git_dir = vim.fn.system("git rev-parse --git-dir 2>/dev/null"):gsub("\n", "") - if vim.v.shell_error == 0 and git_dir ~= "" then - fzf.git_files() - else - fzf.files() - end - end, - desc = "Find files", - }, - { "", function() require("fzf-lua").live_grep() end, desc = "Live grep" }, - - -- Leader keybinds - { "ff", function() require("fzf-lua").files() end, desc = "Files" }, - { "fg", function() require("fzf-lua").live_grep() end, desc = "Live grep" }, - { "fb", function() require("fzf-lua").buffers() end, desc = "Buffers" }, - { "fh", function() require("fzf-lua").help_tags() end, desc = "Help tags" }, - { "fr", function() require("fzf-lua").resume() end, desc = "Resume last search" }, - { "fo", function() require("fzf-lua").oldfiles() end, desc = "Recent files" }, - { "fc", function() require("fzf-lua").commands() end, desc = "Commands" }, - { "fk", function() require("fzf-lua").keymaps() end, desc = "Keymaps" }, - { "f/", function() require("fzf-lua").search_history() end, desc = "Search history" }, - { "f:", function() require("fzf-lua").command_history() end, desc = "Command history" }, - { "fe", function() require("fzf-lua").files({ cwd = "~/.config" }) end, desc = "Config files" }, - -- Quickfix/loclist - { "gq", function() require("fzf-lua").quickfix() end, desc = "Quickfix" }, - { "gl", function() require("fzf-lua").loclist() end, desc = "Loclist" }, - -- Git - { "GB", function() require("fzf-lua").git_branches() end, desc = "Git branches" }, - { "Gc", function() require("fzf-lua").git_commits() end, desc = "Git commits" }, - { "Gs", function() require("fzf-lua").git_status() end, desc = "Git status" }, - }, - opts = { - "default-title", - winopts = { - border = "single", - preview = { - layout = "vertical", - vertical = "down:50%", - }, - }, - fzf_opts = { - ["--layout"] = "reverse", - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/git.lua b/nvim/.config/nvim/lua/plugins/git.lua deleted file mode 100644 index 021ce21..0000000 --- a/nvim/.config/nvim/lua/plugins/git.lua +++ /dev/null @@ -1,83 +0,0 @@ -return { - -- Fugitive: The gold standard for Git in Vim - { - "tpope/vim-fugitive", - cmd = { "Git", "G", "Gread", "Gwrite", "Gdiffsplit", "Gvdiffsplit", "Gblame" }, - keys = { - { "gg", "Gitonly", desc = "Git status (fullscreen)" }, - { "gc", "Git commit", desc = "Git commit" }, - { "gp", "Git push", desc = "Git push" }, - { "gl", "Git pull", desc = "Git pull" }, - { "gb", "Git blame", desc = "Git blame" }, - { "gd", "Gvdiffsplit", desc = "Git diff vertical" }, - { "gr", "Gread", desc = "Git checkout file" }, - { "gw", "Gwrite", desc = "Git add file" }, - }, - }, - - -- Gitsigns: Git info in the gutter - { - "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 = { - { "]g", "Gitsigns next_hunk", desc = "Next hunk" }, - { "[g", "Gitsigns prev_hunk", desc = "Prev hunk" }, - { "ghs", "Gitsigns stage_hunk", desc = "Stage hunk" }, - { "ghr", "Gitsigns reset_hunk", desc = "Reset hunk" }, - { "ghp", "Gitsigns preview_hunk", desc = "Preview hunk" }, - { "gB", "Gitsigns toggle_current_line_blame", desc = "Toggle line blame" }, - }, - }, - - -- Snacks: GitHub integration (browse, issues, PRs) - { - "folke/snacks.nvim", - lazy = false, - opts = { - gitbrowse = {}, - }, - keys = { - { "go", function() Snacks.gitbrowse() end, desc = "Open in GitHub" }, - }, - }, - - -- Diffs.nvim: Better diff highlighting - { - "barrettruth/diffs.nvim", - ft = { "git", "fugitive", "diff" }, - config = function() - vim.g.diffs = { - hide_prefix = true, - highlights = { - gutter = true, - blend_alpha = 0.4, - }, - } - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 43bdccd..0000000 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - { "neovim/nvim-lspconfig", lazy = false }, - { "williamboman/mason.nvim", lazy = false, opts = {} }, - { - "williamboman/mason-lspconfig.nvim", - lazy = false, - opts = { - ensure_installed = { - "lua_ls", - "pyright", - "rust_analyzer", - "gopls", - "clangd", - "bashls", - "jsonls", - "html", - "cssls", - }, - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/oil.lua b/nvim/.config/nvim/lua/plugins/oil.lua deleted file mode 100644 index 2db776a..0000000 --- a/nvim/.config/nvim/lua/plugins/oil.lua +++ /dev/null @@ -1,37 +0,0 @@ -return { - "stevearc/oil.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - lazy = false, - keys = { - { "-", "Oil", desc = "Open parent directory" }, - }, - config = function(_, opts) - require("oil").setup(opts) - vim.api.nvim_create_autocmd("BufEnter", { - pattern = "oil://*", - callback = function() - local dir = require("oil").get_current_dir() - if dir then - vim.cmd.lcd(dir) - end - end, - }) - end, - opts = { - default_file_explorer = true, -- nvim . opens oil - columns = { "icon" }, - view_options = { - show_hidden = true, - }, - keymaps = { - ["g?"] = "actions.show_help", - [""] = "actions.select", - [""] = "actions.select_vsplit", - [""] = "actions.select_split", - [""] = "actions.preview", - [""] = "actions.close", - ["-"] = "actions.parent", - ["g."] = "actions.toggle_hidden", - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/tree.lua b/nvim/.config/nvim/lua/plugins/tree.lua deleted file mode 100644 index 3c70fcc..0000000 --- a/nvim/.config/nvim/lua/plugins/tree.lua +++ /dev/null @@ -1,43 +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 = { - { "", "Neotree toggle", desc = "Toggle file explorer" }, - { "e", "Neotree toggle", desc = "Toggle file explorer" }, - { "", "Neotree toggle", desc = "Toggle file explorer" }, - { "gs", "Neotree git_status left", desc = "Git status tree" }, - }, - config = function() - require("neo-tree").setup({ - close_if_last_window = true, - window = { - width = 30, - mappings = { - [""] = "none", - }, - }, - -- Source selector at top (just Files, no Git tab) - source_selector = { - winbar = false, - }, - filesystem = { - follow_current_file = { - enabled = true, - leave_dirs_open = false, - }, - filtered_items = { - visible = true, - hide_dotfiles = false, - hide_gitignored = false, - hide_hidden = false, - }, - }, - }) - end, -} diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua deleted file mode 100644 index bf8c9c2..0000000 --- a/nvim/.config/nvim/lua/plugins/treesitter.lua +++ /dev/null @@ -1,92 +0,0 @@ -return { - -- 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 = { - ["sn"] = "@parameter.inner", - }, - swap_previous = { - ["sp"] = "@parameter.inner", - }, - }, - }, - }) - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/ui.lua b/nvim/.config/nvim/lua/plugins/ui.lua deleted file mode 100644 index 2ce0b81..0000000 --- a/nvim/.config/nvim/lua/plugins/ui.lua +++ /dev/null @@ -1,155 +0,0 @@ -return { - -- Gruvbox colorscheme - { - "ellisonleao/gruvbox.nvim", - lazy = false, - priority = 1000, - config = function() - require("gruvbox").setup({ - terminal_colors = true, - undercurl = true, - underline = false, - bold = true, - italic = { - strings = false, - emphasis = false, - comments = true, - operators = false, - folds = false, - }, - strikethrough = true, - invert_selection = false, - invert_signs = false, - invert_tabline = false, - invert_intend_guides = false, - inverse = true, - contrast = "hard", - palette_overrides = {}, - overrides = {}, - dim_inactive = false, - transparent_mode = true, - }) - vim.cmd.colorscheme("gruvbox") - end, - }, - - -- Lualine statusline - { - "nvim-lualine/lualine.nvim", - lazy = false, - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("lualine").setup({ - options = { - theme = "gruvbox", - icons_enabled = false, - component_separators = "", - section_separators = "", - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff" }, - lualine_c = { { "filename", path = 1 } }, - lualine_x = { "diagnostics" }, - lualine_y = { "filetype" }, - lualine_z = { "location" }, - }, - }) - 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 = function() require("fzf-lua").files() end, - }, - { - icon = " ", - desc = "Recent Files ", - key = "r", - action = function() require("fzf-lua").oldfiles() end, - }, - { - icon = " ", - desc = "Find Text ", - key = "g", - action = function() require("fzf-lua").live_grep() end, - }, - { - icon = " ", - desc = "File Explorer ", - key = "e", - action = function() vim.cmd("Neotree toggle") end, - }, - { - icon = " ", - desc = "Quit ", - key = "q", - action = function() vim.cmd("quit") end, - }, - }, - footer = {}, - }, - }) - end, - }, - - -- Which-key for keybinding hints - { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - win = { - border = { "┏", "━", "┓", "┃", "┛", "━", "┗", "┃" }, - }, - }, - keys = { - { - "?", - function() - require("which-key").show({ global = false }) - end, - desc = "Buffer Local Keymaps (which-key)", - }, - }, - }, -} diff --git a/nvim/.config/nvim/plugin/autocmds.lua b/nvim/.config/nvim/plugin/autocmds.lua deleted file mode 100644 index 99297af..0000000 --- a/nvim/.config/nvim/plugin/autocmds.lua +++ /dev/null @@ -1,36 +0,0 @@ --- Autocommands -local api = vim.api -local augroup = api.nvim_create_augroup("UserAutocmds", { clear = true }) - --- Highlight on yank -api.nvim_create_autocmd("TextYankPost", { - group = augroup, - callback = function() - vim.highlight.on_yank({ higroup = "Visual", timeout = 200 }) - end, - desc = "Highlight text on yank", -}) - --- Restore cursor position on file open -api.nvim_create_autocmd("BufReadPost", { - group = augroup, - callback = function() - local mark = api.nvim_buf_get_mark(0, '"') - local line_count = api.nvim_buf_line_count(0) - if mark[1] > 0 and mark[1] <= line_count then - pcall(api.nvim_win_set_cursor, 0, mark) - end - end, - desc = "Restore cursor position", -}) - --- Auto-resize splits on VimResized -api.nvim_create_autocmd("VimResized", { - group = augroup, - callback = function() - local current_tab = vim.fn.tabpagenr() - vim.cmd("tabdo wincmd =") - vim.cmd("tabnext " .. current_tab) - end, - desc = "Auto-resize splits", -}) diff --git a/nvim/.config/nvim/plugin/keymaps.lua b/nvim/.config/nvim/plugin/keymaps.lua deleted file mode 100644 index 0de7970..0000000 --- a/nvim/.config/nvim/plugin/keymaps.lua +++ /dev/null @@ -1,26 +0,0 @@ --- Keymaps using global map() helper - --- File operations -map("n", "w", "w", { desc = "Save file" }) -map("n", "q", "q", { desc = "Quit" }) - --- Buffer navigation -map("n", "", "bnext", { desc = "Next buffer" }) -map("n", "", "bprev", { desc = "Previous buffer" }) -map("n", "x", "bdelete", { desc = "Close buffer" }) -map("n", "b", "enew", { desc = "New buffer" }) - --- Window navigation -map("n", "", "h", { desc = "Move to left window" }) -map("n", "", "j", { desc = "Move to lower window" }) -map("n", "", "k", { desc = "Move to upper window" }) -map("n", "", "l", { desc = "Move to right window" }) - --- Better defaults -map("n", "J", "mzJ`z", { desc = "Join lines keeping cursor position" }) -map("x", "x", '"_x', { desc = "Delete char without yanking" }) -map("x", "p", '"_dP', { desc = "Paste without yanking replaced text" }) -map("n", "", "nohlsearch", { desc = "Clear search highlight" }) - --- Terminal -map("t", "", "", { desc = "Exit terminal mode" }) diff --git a/nvim/.config/nvim/plugin/options.lua b/nvim/.config/nvim/plugin/options.lua deleted file mode 100644 index adc5a86..0000000 --- a/nvim/.config/nvim/plugin/options.lua +++ /dev/null @@ -1,47 +0,0 @@ --- Vim options -local o, opt = vim.o, vim.opt - --- Line numbers -o.number = true -o.relativenumber = true - --- Indentation -o.tabstop = 2 -o.shiftwidth = 2 -o.expandtab = true -o.smartindent = true -o.breakindent = true - --- Search -o.ignorecase = true -o.smartcase = true -o.hlsearch = false -o.incsearch = true - --- UI -o.termguicolors = true -o.cursorline = true -o.scrolloff = 8 -o.signcolumn = "yes" -o.wrap = false -o.showmode = false -o.laststatus = 3 -o.cmdheight = 0 - -opt.fillchars = { vert = "│", fold = "─", foldsep = "│", diff = "─" } -opt.shortmess:append("S") - --- Splits -o.splitbelow = true -o.splitright = true - --- Files -o.swapfile = false -o.backup = false -o.undofile = true -o.undodir = vim.fn.stdpath("data") .. "/undo" - --- Misc -o.updatetime = 250 -o.mouse = "a" -o.clipboard = "unnamedplus"