From 1ae2321378b2c6c4a35d951702198fdcd737b804 Mon Sep 17 00:00:00 2001 From: Nicholai Date: Wed, 4 Feb 2026 23:36:13 -0700 Subject: [PATCH] Add comment.nvim, nvim-surround, harpoon, flash.nvim, indent-blankline, todo-comments.nvim, trouble.nvim, undotree, and pywal.nvim + themeswitcher --- docs/neovim-cheatsheet.md | 36 ++++++- lazy-lock.json | 9 ++ lua/plugins/colors.lua | 0 lua/plugins/plugin.lua | 203 +++++++++++++++++++++++++++++++++++--- 4 files changed, 236 insertions(+), 12 deletions(-) create mode 100644 lua/plugins/colors.lua diff --git a/docs/neovim-cheatsheet.md b/docs/neovim-cheatsheet.md index 7e115a6..a059bf3 100644 --- a/docs/neovim-cheatsheet.md +++ b/docs/neovim-cheatsheet.md @@ -117,6 +117,40 @@ - `Tab` - Next completion item - `Shift+Tab` - Previous completion item +### Commenting (Comment.nvim) +- `gcc` - Toggle comment on line +- `gc{motion}` - Toggle comment with motion (e.g., `gc3j` comments 3 lines down) +- `gbc` - Toggle block comment +- Visual mode: `gc` - Comment selection + +### Surround (nvim-surround) +- `ys{motion}{char}` - Add surround (e.g., `ysiw"` surrounds word with quotes) +- `ds{char}` - Delete surround (e.g., `ds"` removes quotes) +- `cs{old}{new}` - Change surround (e.g., `cs"'` changes `"` to `'`) +- Visual mode: `S{char}` - Surround selection + +### Harpoon (quick file switching) +- `Space+ha` - Add current file to harpoon +- `Space+hh` - Open harpoon menu +- `Space+1/2/3/4` - Jump to harpoon file 1-4 + +### Flash (supercharged motions) +- `s` - Flash jump (type chars to jump to) +- `S` - Flash treesitter select + +### Diagnostics (Trouble) +- `Space+xx` - Toggle diagnostics panel +- `Space+xX` - Buffer diagnostics only +- `Space+xl` - Location list +- `Space+xq` - Quickfix list + +### Theme Switcher +- `Space+th` - Open theme picker (pywal, kanagawa variants, or pick new wallpaper) + +### Utilities +- `Space+u` - Toggle undo tree +- `Space+ft` - Find TODOs in project + ## Useful Tips - **Repeat actions**: Number before command (e.g., `5dd` deletes 5 lines) - **Combine motions**: `d3w` deletes 3 words, `y2j` yanks 2 lines down @@ -150,4 +184,4 @@ - System clipboard integration: Just yank normally with `y` - it copies to system clipboard! (You have `clipboard=unnamedplus` set) --- -*Last updated: November 2025* +*Last updated: February 2026* diff --git a/lazy-lock.json b/lazy-lock.json index 3bcbe33..a30a67b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,6 @@ { "99": { "branch": "master", "commit": "0fb3b8b2d032289ea7088a37161e1c50bdfccfa9" }, + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, "alpha-nvim": { "branch": "main", "commit": "3979b01cb05734331c7873049001d3f2bb8477f4" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, @@ -8,8 +9,11 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "gitsigns.nvim": { "branch": "main", "commit": "1ce96a464fdbc24208e24c117e2021794259005d" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "kanagawa": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, @@ -19,11 +23,16 @@ "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, "nvim-colorizer.lua": { "branch": "master", "commit": "338409dd8a6ed74767bad3eb5269f1b903ffb3cf" }, "nvim-lspconfig": { "branch": "master", "commit": "0480b120318ec8bab27b530ffab6ee76a8c4d806" }, + "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" }, "nvim-tree.lua": { "branch": "master", "commit": "037d89e60fb01a6c11a48a19540253b8c72a3c32" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "pywal": { "branch": "main", "commit": "d11b673c0e3d6eb8cbee7ea8cf4a8911f6ee24b9" }, "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "typescript-tools.nvim": { "branch": "master", "commit": "c2f5910074103705661e9651aa841e0d7eea9932" }, + "undotree": { "branch": "master", "commit": "fc28931fbfba66ab75d9af23fe46ffbbb9de6e8c" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/plugins/colors.lua b/lua/plugins/colors.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/plugins/plugin.lua b/lua/plugins/plugin.lua index 81cacc5..4ad4838 100644 --- a/lua/plugins/plugin.lua +++ b/lua/plugins/plugin.lua @@ -6,33 +6,119 @@ return { priority = 1000, config = function() require('kanagawa').setup({ - compile = true, -- enable compiling the colorscheme - undercurl = true, -- enable undercurls + compile = true, + undercurl = true, commentStyle = { italic = true }, functionStyle = {}, keywordStyle = { italic = true }, statementStyle = { bold = true }, typeStyle = {}, - transparent = false, -- do not set background color - dimInactive = false, -- dim inactive window `:h hl-NormalNC` - terminalColors = true, -- define vim.g.terminal_color_{0,17} - colors = { -- add/modify theme and palette colors + transparent = false, + dimInactive = false, + terminalColors = true, + colors = { palette = {}, theme = { wave = {}, lotus = {}, dragon = {}, all = {} }, }, - overrides = function(colors) -- add/modify highlights + overrides = function(colors) return {} end, - theme = "wave", -- Load "wave" theme - background = { -- map the value of 'background' option to a theme - dark = "wave", -- try "dragon" ! + theme = "wave", + background = { + dark = "wave", light = "lotus" }, }) - vim.cmd("colorscheme kanagawa") + -- only set kanagawa if pywal colors don't exist + if vim.fn.filereadable(vim.fn.expand("~/.cache/wal/colors")) == 0 then + vim.cmd("colorscheme kanagawa") + end end, }, + -- Pywal colorscheme (syncs with terminal) + { + "AlphaTechnolog/pywal.nvim", + name = "pywal", + priority = 1000, + config = function() + -- auto-load pywal if colors exist + if vim.fn.filereadable(vim.fn.expand("~/.cache/wal/colors")) == 1 then + vim.cmd("colorscheme pywal") + end + end, + }, + + -- Theme switcher + { + "nvim-telescope/telescope.nvim", + keys = { + { + "th", + function() + local pickers = require("telescope.pickers") + local finders = require("telescope.finders") + local conf = require("telescope.config").values + local actions = require("telescope.actions") + local action_state = require("telescope.actions.state") + + local themes = { + { name = "pywal (from wallpaper)", value = "pywal" }, + { name = "Pick new wallpaper...", value = "_wallpaper_picker" }, + { name = "kanagawa", value = "kanagawa" }, + { name = "kanagawa-wave", value = "kanagawa-wave" }, + { name = "kanagawa-dragon", value = "kanagawa-dragon" }, + { name = "kanagawa-lotus", value = "kanagawa-lotus" }, + } + + pickers.new({}, { + prompt_title = "Theme Switcher", + finder = finders.new_table({ + results = themes, + entry_maker = function(entry) + return { + value = entry.value, + display = entry.name, + ordinal = entry.name, + } + end, + }), + sorter = conf.generic_sorter({}), + attach_mappings = function(prompt_bufnr, map) + actions.select_default:replace(function() + actions.close(prompt_bufnr) + local selection = action_state.get_selected_entry() + if selection.value == "_wallpaper_picker" then + -- launch wallpaper picker, then reload pywal + vim.fn.jobstart( + { "bash", "-c", "~/scripts/pywal/wallpapermenu.sh && sleep 1" }, + { + on_exit = function() + vim.schedule(function() + vim.cmd("colorscheme pywal") + require("lualine").setup({ options = { theme = "pywal" } }) + vim.notify("Pywal theme applied", vim.log.levels.INFO) + end) + end, + } + ) + else + vim.cmd("colorscheme " .. selection.value) + -- update lualine theme + local lualine_theme = selection.value:match("^kanagawa") and "kanagawa" or selection.value + require("lualine").setup({ options = { theme = lualine_theme } }) + vim.notify("Theme: " .. selection.value, vim.log.levels.INFO) + end + end) + return true + end, + }):find() + end, + desc = "Theme switcher", + }, + }, + }, + -- File explorer { "nvim-tree/nvim-tree.lua", @@ -236,6 +322,95 @@ return { end, }, + -- Commenting + { + "numToStr/Comment.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = {}, + }, + + -- Surround text objects + { + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + opts = {}, + }, + + -- Quick file navigation + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") + harpoon:setup() + + vim.keymap.set("n", "ha", function() harpoon:list():add() end, { desc = "Harpoon add" }) + vim.keymap.set("n", "hh", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = "Harpoon menu" }) + vim.keymap.set("n", "1", function() harpoon:list():select(1) end, { desc = "Harpoon 1" }) + vim.keymap.set("n", "2", function() harpoon:list():select(2) end, { desc = "Harpoon 2" }) + vim.keymap.set("n", "3", function() harpoon:list():select(3) end, { desc = "Harpoon 3" }) + vim.keymap.set("n", "4", function() harpoon:list():select(4) end, { desc = "Harpoon 4" }) + end, + }, + + -- Flash motions + { + "folke/flash.nvim", + event = "VeryLazy", + opts = {}, + 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" }, + }, + }, + + -- Indent guides + { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + event = { "BufReadPre", "BufNewFile" }, + opts = { + indent = { char = "│" }, + scope = { enabled = true }, + }, + }, + + -- TODO comments + { + "folke/todo-comments.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, + keys = { + { "ft", "TodoTelescope", desc = "Find TODOs" }, + }, + }, + + -- Diagnostics list + { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + cmd = "Trouble", + keys = { + { "xx", "Trouble diagnostics toggle", desc = "Diagnostics" }, + { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer diagnostics" }, + { "xl", "Trouble loclist toggle", desc = "Location list" }, + { "xq", "Trouble qflist toggle", desc = "Quickfix list" }, + }, + opts = {}, + }, + + -- Undo tree + { + "mbbill/undotree", + cmd = "UndotreeToggle", + keys = { + { "u", "UndotreeToggle", desc = "Toggle undotree" }, + }, + }, + -- Which-key { "folke/which-key.nvim", @@ -252,9 +427,15 @@ return { { "ff", desc = "Find files" }, { "fg", desc = "Live grep" }, { "fb", desc = "Find buffers" }, + { "ft", desc = "Find TODOs" }, { "g", group = "Git" }, + { "h", group = "Harpoon" }, + { "t", group = "Theme" }, + { "th", desc = "Theme switcher" }, + { "x", group = "Trouble" }, { "w", desc = "Save" }, { "q", desc = "Quit" }, + { "u", desc = "Undo tree" }, { "9", group = "AI (99)" }, { "9f", desc = "Fill Function" }, { "9v", desc = "Visual AI" },