From 77c3b62a354b4da59a4a684232902e57633bb759 Mon Sep 17 00:00:00 2001 From: Harivansh Rathi Date: Fri, 20 Feb 2026 18:49:23 -0500 Subject: [PATCH] clean --- README.md | 8 +++---- lazy-lock.json | 6 ------ lua/config/lsp.lua | 4 ---- lua/plugins/editor.lua | 9 +++++--- lua/plugins/git.lua | 47 +++++++++++++++++++++++++++++++----------- lua/plugins/lsp.lua | 21 ------------------- lua/plugins/oil.lua | 2 ++ lua/plugins/tree.lua | 43 -------------------------------------- lua/plugins/ui.lua | 3 ++- 9 files changed, 48 insertions(+), 95 deletions(-) delete mode 100644 lua/plugins/tree.lua diff --git a/README.md b/README.md index 0bec656..dea5713 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ curl -fsSL https://raw.githubusercontent.com/harivansh-afk/nvim/main/install.sh | bash ``` -**Full install** - includes LSP + supermaven AI completion: +**Full install** - includes LSP + Supermaven inline AI: ```bash curl -fsSL https://raw.githubusercontent.com/harivansh-afk/nvim/main/install.sh | bash -s -- --bells-and-whistles ``` @@ -38,9 +38,7 @@ Other options: │ ├── gitsigns.lua │ ├── gutentags.lua │ ├── lsp.lua -│ ├── neo-tree.lua │ ├── nvchad.lua -│ ├── supermaven.lua │ ├── telescope.lua │ ├── treesitter.lua │ └── which-key.lua @@ -55,7 +53,7 @@ Other options: - `nvim-telescope/telescope.nvim`: fuzzy find + grep. - `nvim-treesitter/nvim-treesitter`: better syntax highlight/indent. - `neovim/nvim-lspconfig` + `williamboman/mason.nvim`: LSP + install servers. -- `nvim-neo-tree/neo-tree.nvim`: file explorer. +- `stevearc/oil.nvim`: file explorer. - `nvimdev/dashboard-nvim`: startup dashboard. - `folke/which-key.nvim`: keybind hint popup. - `numToStr/Comment.nvim`: quick commenting. @@ -64,5 +62,5 @@ Other options: - `lewis6991/gitsigns.nvim`: git hunks in-buffer. - `NeogitOrg/neogit` + `sindrets/diffview.nvim`: git UI + diffs/history. - `ludovicchabant/vim-gutentags`: ctags-based fallback navigation. -- `supermaven-inc/supermaven-nvim`: AI inline suggestions. +- `supermaven-inc/supermaven-nvim`: inline AI suggestions. - `otavioschwanck/arrow.nvim`: quick file marks/jumps. diff --git a/lazy-lock.json b/lazy-lock.json index b7b9b9b..76cc497 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,17 +1,13 @@ { - "blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" }, "dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" }, "diffs.nvim": { "branch": "main", "commit": "b1abfe4f4a164ad776148ca36f852df4f1e4014e" }, "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, - "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "fzf-lua": { "branch": "main", "commit": "b2c0603216adb92c6bba81053bc996d7ae95b77a" }, "gitsigns.nvim": { "branch": "main", "commit": "9f3c6dd7868bcc116e9c1c1929ce063b978fa519" }, "gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, "nonicons.nvim": { "branch": "main", "commit": "62549ecb9906e4216398c44af96719ca4cc670ef" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, "nvim-lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" }, "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" }, @@ -21,9 +17,7 @@ "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, "oil-git.nvim": { "branch": "main", "commit": "c99db7b1dd8dd500c3ec530dc07000dfbeb6e080" }, "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" } } diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index c5bbeda..94e164e 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -27,10 +27,6 @@ end -- Return default capabilities for LSP servers function M.capabilities() - local ok, blink = pcall(require, "blink.cmp") - if ok then - return blink.get_lsp_capabilities() - end return vim.lsp.protocol.make_client_capabilities() end diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 43e0ffd..74ec1e3 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -52,24 +52,27 @@ return { }, }, - -- Supermaven AI completion + -- Supermaven inline suggestions (accepted with Tab) { "supermaven-inc/supermaven-nvim", event = "InsertEnter", + config = function(_, opts) + require("supermaven-nvim").setup(opts) + end, opts = { keymaps = { accept_suggestion = "", clear_suggestion = "", accept_word = "", }, - ignore_filetypes = { "gitcommit", "TelescopePrompt" }, + disable_keymaps = false, + ignore_filetypes = { gitcommit = true }, 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/lua/plugins/git.lua b/lua/plugins/git.lua index 09f5b22..fafed3b 100644 --- a/lua/plugins/git.lua +++ b/lua/plugins/git.lua @@ -1,3 +1,37 @@ +local function current_file_location() + local root = vim.trim(vim.fn.system("git rev-parse --show-toplevel")) + if vim.v.shell_error ~= 0 or root == "" then + return nil + end + + local path = vim.api.nvim_buf_get_name(0) + if path == "" then + return nil + end + + local prefix = root .. "/" + if path:sub(1, #prefix) ~= prefix then + return nil + end + + local rel = path:sub(#prefix + 1) + return ("%s:%d"):format(rel, vim.fn.line(".")) +end + +local function gh_browse() + if vim.fn.executable("gh") ~= 1 then + vim.notify("gh CLI not found", vim.log.levels.WARN) + return + end + + local loc = current_file_location() + if loc then + vim.system({ "gh", "browse", loc }) + return + end + vim.system({ "gh", "browse" }) +end + return { -- Fugitive: The gold standard for Git in Vim { @@ -12,6 +46,7 @@ return { { "gd", "Gvdiffsplit", desc = "Git diff vertical" }, { "gr", "Gread", desc = "Git checkout file" }, { "gw", "Gwrite", desc = "Git add file" }, + { "go", gh_browse, desc = "Open in GitHub" }, }, }, @@ -54,18 +89,6 @@ return { }, }, - -- 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", diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 32af049..65bbe2c 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,24 +1,3 @@ return { { "neovim/nvim-lspconfig", lazy = false }, - - -- Autocompletion - { - "saghen/blink.cmp", - dependencies = { "rafamadriz/friendly-snippets" }, - version = "1.*", - event = "InsertEnter", - - ---@module 'blink.cmp' - ---@type blink.cmp.Config - opts = { - keymap = { preset = "default" }, - appearance = { nerd_font_variant = "mono" }, - completion = { documentation = { auto_show = true } }, - sources = { - default = { "lsp", "path", "snippets", "buffer" }, - }, - fuzzy = { implementation = "prefer_rust_with_warning" }, - }, - opts_extend = { "sources.default" }, - }, } diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 97bc5b4..7214e15 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -1,9 +1,11 @@ return { "stevearc/oil.nvim", dependencies = { "nvim-tree/nvim-web-devicons", "malewicz1337/oil-git.nvim" }, + cmd = "Oil", event = 'VeryLazy', keys = { { "-", "Oil", desc = "Open parent directory" }, + { "e", "Oil", desc = "Open file explorer" }, }, config = function(_, opts) require("oil").setup(opts) diff --git a/lua/plugins/tree.lua b/lua/plugins/tree.lua deleted file mode 100644 index 3c70fcc..0000000 --- a/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/lua/plugins/ui.lua b/lua/plugins/ui.lua index 6151be6..f69ad1d 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -32,6 +32,7 @@ return { transparent_mode = true, }) vim.cmd.colorscheme("gruvbox") + end, }, @@ -120,7 +121,7 @@ return { icon = " ", desc = "File Explorer ", key = "e", - action = function() vim.cmd("Neotree toggle") end, + action = function() vim.cmd("Oil") end, }, { icon = " ",