From 5b354f172ec17032aee3a065ec163888b309c519 Mon Sep 17 00:00:00 2001 From: Adam French Date: Tue, 7 Jul 2026 13:11:02 +0100 Subject: [PATCH] Clean up nvim config: drop duplicate plugins, simplify colorscheme setup - Remove nvim-autopairs (LazyVim's mini.pairs already handles pairing) - Remove spectre (superseded by LazyVim's grug-far, conflicted on sr) - Remove todo-comments override (LazyVim default covers it; st pointed at TodoTelescope, which is broken without telescope) - Trim colorscheme.lua to oxocarbon only, set via LazyVim opts; fix install colorscheme in lazy.lua - Delete disabled greggh/claude-code.nvim spec - Drop obsolete which-key config function and empty defaults table - Tile vertically for any multi-file open, not just exactly two - Add stylua.toml and format all lua to 2-space indent Co-Authored-By: Claude Fable 5 --- nvim/lua/config/autocmds.lua | 2 +- nvim/lua/config/lazy.lua | 2 +- nvim/lua/plugins/autopairs.lua | 8 -- nvim/lua/plugins/claudecode.lua | 100 +++++++++-------------- nvim/lua/plugins/colorscheme.lua | 45 +++-------- nvim/lua/plugins/harpoon.lua | 1 - nvim/lua/plugins/markview.lua | 2 +- nvim/lua/plugins/neogit.lua | 34 ++++++-- nvim/lua/plugins/snacks.lua | 46 +++++------ nvim/lua/plugins/spectre.lua | 11 --- nvim/lua/plugins/todo-comments.lua | 14 ---- nvim/lua/plugins/undotree.lua | 2 +- nvim/lua/plugins/vimade.lua | 22 ++--- nvim/lua/plugins/whichkey.lua | 125 +++++++++++++---------------- nvim/stylua.toml | 3 + 15 files changed, 176 insertions(+), 241 deletions(-) delete mode 100644 nvim/lua/plugins/autopairs.lua delete mode 100644 nvim/lua/plugins/spectre.lua delete mode 100644 nvim/lua/plugins/todo-comments.lua create mode 100644 nvim/stylua.toml diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index 2ec3018..fd0a4d4 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -10,7 +10,7 @@ -- When opening multiple files, tile them vertically (side by side) vim.api.nvim_create_autocmd("VimEnter", { callback = function() - if vim.fn.argc() == 2 then + if vim.fn.argc() > 1 then vim.cmd("vertical ball") end end, diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index d73bfa1..50fd671 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -30,7 +30,7 @@ require("lazy").setup({ version = false, -- always use the latest git commit -- version = "*", -- try installing the latest stable version for plugins that support semver }, - install = { colorscheme = { "tokyonight", "habamax" } }, + install = { colorscheme = { "oxocarbon", "habamax" } }, checker = { enabled = true, -- check for plugin updates periodically notify = false, -- notify on update diff --git a/nvim/lua/plugins/autopairs.lua b/nvim/lua/plugins/autopairs.lua deleted file mode 100644 index 5aeade2..0000000 --- a/nvim/lua/plugins/autopairs.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - { - "windwp/nvim-autopairs", - event = "InsertEnter", - opts = {}, - }, -} - diff --git a/nvim/lua/plugins/claudecode.lua b/nvim/lua/plugins/claudecode.lua index 8233edd..b755887 100644 --- a/nvim/lua/plugins/claudecode.lua +++ b/nvim/lua/plugins/claudecode.lua @@ -1,64 +1,40 @@ return { - { - "coder/claudecode.nvim", - dependencies = { "folke/snacks.nvim" }, - opts = { - terminal = { - provider = "snacks", - snacks_win_opts = { - relative = "win", - position = "bottom", - height = 0.3, - split_width_percentage = 0.99, - }, - }, - diff_opts = { - layout = "vertical", - open_in_new_tab = true, - keep_terminal_focus = true, - }, - }, - keys = { - { "a", "", desc = "+ai", mode = { "n", "v" } }, - { "ac", "ClaudeCode", desc = "Toggle Claude" }, - { "af", "ClaudeCodeFocus", desc = "Focus Claude" }, - { "ar", "ClaudeCode --resume", desc = "Resume Claude" }, - { "aC", "ClaudeCode --continue", desc = "Continue Claude" }, - { "ab", "ClaudeCodeAdd %", desc = "Add current buffer" }, - { "as", "ClaudeCodeSend", mode = "v", desc = "Send to Claude" }, - { - "as", - "ClaudeCodeTreeAdd", - desc = "Add file", - ft = { "NvimTree", "neo-tree", "oil" }, - }, - -- Diff management - { "aa", "ClaudeCodeDiffAccept", desc = "Accept diff" }, - { "ad", "ClaudeCodeDiffDeny", desc = "Deny diff" }, - }, - }, - - -- Disabled: unmaintained - { - "greggh/claude-code.nvim", - enabled = false, - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - position = "float", - float_opts = { - relative = "win", - width = "80%", - height = "80%", - row = "center", - col = "center", - border = "rounded", - }, - }, - keys = { - { "a", nil, desc = "AI/Claude Code" }, - { "ac", "ClaudeCode", desc = "Toggle Claude" }, - { "ar", "ClaudeCodeResume", desc = "Resume Claude" }, - { "aC", "ClaudeCodeContinue", desc = "Continue Claude" }, - }, - }, + { + "coder/claudecode.nvim", + dependencies = { "folke/snacks.nvim" }, + opts = { + terminal = { + provider = "snacks", + snacks_win_opts = { + relative = "win", + position = "bottom", + height = 0.3, + split_width_percentage = 0.99, + }, + }, + diff_opts = { + layout = "vertical", + open_in_new_tab = true, + keep_terminal_focus = true, + }, + }, + keys = { + { "a", "", desc = "+ai", mode = { "n", "v" } }, + { "ac", "ClaudeCode", desc = "Toggle Claude" }, + { "af", "ClaudeCodeFocus", desc = "Focus Claude" }, + { "ar", "ClaudeCode --resume", desc = "Resume Claude" }, + { "aC", "ClaudeCode --continue", desc = "Continue Claude" }, + { "ab", "ClaudeCodeAdd %", desc = "Add current buffer" }, + { "as", "ClaudeCodeSend", mode = "v", desc = "Send to Claude" }, + { + "as", + "ClaudeCodeTreeAdd", + desc = "Add file", + ft = { "NvimTree", "neo-tree", "oil" }, + }, + -- Diff management + { "aa", "ClaudeCodeDiffAccept", desc = "Accept diff" }, + { "ad", "ClaudeCodeDiffDeny", desc = "Deny diff" }, + }, + }, } diff --git a/nvim/lua/plugins/colorscheme.lua b/nvim/lua/plugins/colorscheme.lua index b1a39ea..716549d 100644 --- a/nvim/lua/plugins/colorscheme.lua +++ b/nvim/lua/plugins/colorscheme.lua @@ -1,37 +1,12 @@ return { - { - "nyoom-engineering/oxocarbon.nvim", - lazy = false, - priority = 1000, - config = function() - vim.opt.background = "dark" - vim.cmd("colorscheme oxocarbon") - end, - }, - { - "sainnhe/sonokai", - opts = { - sonokai_style = "atlantis", - sonokai_transparent_background = 1, - sonokai_enable_italic = true, - }, - }, - { - "folke/tokyonight.nvim", - opts = { - style = "night", - transparent = true, - styles = { comments = { italic = true } }, - }, - }, - { - "loctvl842/monokai-pro.nvim", - opts = { - transparent_background = true, - filter = "spectrum", - }, - }, - { "scottmckendry/cyberdream.nvim" }, - { "maxmx03/fluoromachine.nvim" }, - { "rafamadriz/neon" }, + { "nyoom-engineering/oxocarbon.nvim", lazy = false, priority = 1000 }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = function() + vim.opt.background = "dark" + vim.cmd("colorscheme oxocarbon") + end, + }, + }, } diff --git a/nvim/lua/plugins/harpoon.lua b/nvim/lua/plugins/harpoon.lua index af0e019..d868bea 100644 --- a/nvim/lua/plugins/harpoon.lua +++ b/nvim/lua/plugins/harpoon.lua @@ -51,4 +51,3 @@ return { }, }, } - diff --git a/nvim/lua/plugins/markview.lua b/nvim/lua/plugins/markview.lua index 1de2d5a..fd5d48d 100644 --- a/nvim/lua/plugins/markview.lua +++ b/nvim/lua/plugins/markview.lua @@ -8,4 +8,4 @@ return { }, opts = {}, }, -} \ No newline at end of file +} diff --git a/nvim/lua/plugins/neogit.lua b/nvim/lua/plugins/neogit.lua index a5cd74e..27914ae 100644 --- a/nvim/lua/plugins/neogit.lua +++ b/nvim/lua/plugins/neogit.lua @@ -6,10 +6,34 @@ return { "sindrets/diffview.nvim", }, keys = { - { "gg", function() require("neogit").open() end, desc = "Neogit" }, - { "gc", function() require("neogit").open({ "commit" }) end, desc = "Neogit Commit" }, - { "gl", function() require("neogit").open({ "log" }) end, desc = "Neogit Log" }, - { "gp", function() require("neogit").open({ "push" }) end, desc = "Neogit Push" }, + { + "gg", + function() + require("neogit").open() + end, + desc = "Neogit", + }, + { + "gc", + function() + require("neogit").open({ "commit" }) + end, + desc = "Neogit Commit", + }, + { + "gl", + function() + require("neogit").open({ "log" }) + end, + desc = "Neogit Log", + }, + { + "gp", + function() + require("neogit").open({ "push" }) + end, + desc = "Neogit Push", + }, }, opts = { integrations = { @@ -17,4 +41,4 @@ return { }, }, }, -} \ No newline at end of file +} diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua index 95002c2..bdbc309 100644 --- a/nvim/lua/plugins/snacks.lua +++ b/nvim/lua/plugins/snacks.lua @@ -1,23 +1,23 @@ return { - { - "snacks.nvim", - keys = { - { - "?", - function() - Snacks.picker.keymaps() - end, - desc = "Search Keymaps", - mode = { "n", "x" }, - }, - }, - opts = { - dashboard = { - preset = { - pick = function(cmd, opts) - return LazyVim.pick(cmd, opts)() - end, - header = [[ + { + "snacks.nvim", + keys = { + { + "?", + function() + Snacks.picker.keymaps() + end, + desc = "Search Keymaps", + mode = { "n", "x" }, + }, + }, + opts = { + dashboard = { + preset = { + pick = function(cmd, opts) + return LazyVim.pick(cmd, opts)() + end, + header = [[ ███████╗████████╗██████╗ ██╔════╝╚══██╔══╝██╔══██╗ ███████╗ ██║ ██████╔╝ @@ -37,8 +37,8 @@ return { { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" }, { icon = " ", key = "q", desc = "Quit", action = ":qa" }, }, - }, - }, - }, - }, + }, + }, + }, + }, } diff --git a/nvim/lua/plugins/spectre.lua b/nvim/lua/plugins/spectre.lua deleted file mode 100644 index 0aea872..0000000 --- a/nvim/lua/plugins/spectre.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - "nvim-pack/nvim-spectre", - dependencies = { "nvim-lua/plenary.nvim" }, - keys = { - { "sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" }, - { "sr", function() require("spectre").open_visual({ select_word = true }) end, mode = "v", desc = "Replace Word (Spectre)" }, - }, - opts = {}, - }, -} \ No newline at end of file diff --git a/nvim/lua/plugins/todo-comments.lua b/nvim/lua/plugins/todo-comments.lua deleted file mode 100644 index 687d4ca..0000000 --- a/nvim/lua/plugins/todo-comments.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { - "folke/todo-comments.nvim", - event = "VeryLazy", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = {}, - keys = { - { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, - { "[t", function() require("todo-comments").jump_prev() end, desc = "Prev Todo Comment" }, - { "xt", "Trouble todo", desc = "Todo (Trouble)" }, - { "st", "TodoTelescope", desc = "Todo" }, - }, - }, -} \ No newline at end of file diff --git a/nvim/lua/plugins/undotree.lua b/nvim/lua/plugins/undotree.lua index a33e110..47e5407 100644 --- a/nvim/lua/plugins/undotree.lua +++ b/nvim/lua/plugins/undotree.lua @@ -5,4 +5,4 @@ return { { "cu", "UndotreeToggle", desc = "Undotree Toggle" }, }, }, -} \ No newline at end of file +} diff --git a/nvim/lua/plugins/vimade.lua b/nvim/lua/plugins/vimade.lua index 1daa2f9..3c78b84 100644 --- a/nvim/lua/plugins/vimade.lua +++ b/nvim/lua/plugins/vimade.lua @@ -1,13 +1,13 @@ return { - "TaDaa/vimade", - event = "WinNew", - opts = { - recipe = { "minimalist", { animate = true } }, - fadelevel = 0.8, - blocklist = { - claude_terminal = { - buf_opts = { ft = "snacks_terminal" }, - }, - }, - }, + "TaDaa/vimade", + event = "WinNew", + opts = { + recipe = { "minimalist", { animate = true } }, + fadelevel = 0.8, + blocklist = { + claude_terminal = { + buf_opts = { ft = "snacks_terminal" }, + }, + }, + }, } diff --git a/nvim/lua/plugins/whichkey.lua b/nvim/lua/plugins/whichkey.lua index 89529a3..f8c4187 100644 --- a/nvim/lua/plugins/whichkey.lua +++ b/nvim/lua/plugins/whichkey.lua @@ -1,69 +1,60 @@ return { - { - "folke/which-key.nvim", - event = "VeryLazy", - opts_extend = { "spec" }, - opts = { - preset = "helix", - defaults = {}, - spec = { - { - mode = { "n", "x" }, - { "", group = "tabs" }, - { "c", group = "code" }, - { "d", group = "debug" }, - { "dp", group = "profiler" }, - { "f", group = "file/find" }, - { "g", group = "git" }, - { "gh", group = "hunks" }, - { "q", group = "quit/session" }, - { "s", group = "search" }, - { "u", group = "ui" }, - { "x", group = "diagnostics/quickfix" }, - { "[", group = "prev" }, - { "]", group = "next" }, - { "g", group = "goto" }, - { "gs", group = "surround" }, - { "z", group = "fold" }, - { - "b", - group = "buffer", - expand = function() - return require("which-key.extras").expand.buf() - end, - }, - { - "w", - group = "windows", - proxy = "", - expand = function() - return require("which-key.extras").expand.win() - end, - }, - -- better descriptions - { "gx", desc = "Open with system app" }, - { "gc", group = "comment", desc = "Toggle comment" }, - }, - }, - }, - keys = { - -- disable LazyVim's default ? so the snacks keymaps picker owns it - { "?", false }, - { - "", - function() - require("which-key").show({ keys = "", loop = true }) - end, - desc = "Window Hydra Mode (which-key)", - }, - }, - config = function(_, opts) - local wk = require("which-key") - wk.setup(opts) - if not vim.tbl_isempty(opts.defaults) then - LazyVim.warn("which-key: opts.defaults is deprecated. Please use opts.spec instead.") - wk.register(opts.defaults) - end - end, - }, + { + "folke/which-key.nvim", + event = "VeryLazy", + opts_extend = { "spec" }, + opts = { + preset = "helix", + spec = { + { + mode = { "n", "x" }, + { "", group = "tabs" }, + { "c", group = "code" }, + { "d", group = "debug" }, + { "dp", group = "profiler" }, + { "f", group = "file/find" }, + { "g", group = "git" }, + { "gh", group = "hunks" }, + { "q", group = "quit/session" }, + { "s", group = "search" }, + { "u", group = "ui" }, + { "x", group = "diagnostics/quickfix" }, + { "[", group = "prev" }, + { "]", group = "next" }, + { "g", group = "goto" }, + { "gs", group = "surround" }, + { "z", group = "fold" }, + { + "b", + group = "buffer", + expand = function() + return require("which-key.extras").expand.buf() + end, + }, + { + "w", + group = "windows", + proxy = "", + expand = function() + return require("which-key.extras").expand.win() + end, + }, + -- better descriptions + { "gx", desc = "Open with system app" }, + { "gc", group = "comment", desc = "Toggle comment" }, + }, + }, + }, + keys = { + -- disable LazyVim's default ? so the snacks keymaps picker owns it + { "?", false }, + { + "", + function() + require("which-key").show({ keys = "", loop = true }) + end, + desc = "Window Hydra Mode (which-key)", + }, + }, + }, } diff --git a/nvim/stylua.toml b/nvim/stylua.toml new file mode 100644 index 0000000..0f90030 --- /dev/null +++ b/nvim/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120