From db4fbbbd82c4f71205dc1dcc811b31189a67d24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Wi=C4=85cek?= Date: Sat, 23 May 2026 01:19:11 +0200 Subject: [PATCH 1/3] Spring cleaning --- README.md | 4 +- init.lua | 1 - lua/autocommands.lua | 2 +- lua/{health.lua => health/nvim.lua} | 0 lua/language-servers/lua-language-server.lua | 4 ++ lua/mappings.lua | 8 +--- lua/plugins/claudecode.lua | 2 +- lua/plugins/claudecode.rs | 34 ---------------- lua/plugins/cmp.lua | 42 +++++++------------- lua/plugins/indent-blankline.lua | 2 +- lua/plugins/lspconfig.lua | 1 + lua/plugins/neoscroll.lua | 1 - lua/plugins/telescope.lua | 2 +- lua/plugins/tokyonight.lua | 2 +- lua/plugins/treesitter-textobjects.lua | 16 -------- 15 files changed, 29 insertions(+), 92 deletions(-) rename lua/{health.lua => health/nvim.lua} (100%) delete mode 100644 lua/plugins/claudecode.rs diff --git a/README.md b/README.md index 9ec8d85..e95ff5b 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,12 @@ Then, run `:Lazy` to install plugins. - `;` opens command mode (`:`) - more comfortable than Shift+; - `g` opens a popup window with recursive grep search in the current directory. Blazing fast ⚡ thanks to `ripgrep` - `f` does the same but with file names using Telescope 🔥 - - `t` opens a terminal in vertical split on the right already in insert mode. Ready to type commands 👨‍💻 + - `` opens a terminal in vertical split on the right already in insert mode. Ready to type commands 👨‍💻 - `n` opens neogit 🌳 - `o` opens file manager in a floating window 🛢️ - `` shows git diff of the current line thanks to `gitsigns` - `` (un)comments either current line, or visually selected block of code 🔎 - - `m` activates leap motion for quick navigation within visible text + - `m` activates leap motion for quick navigation within visible text (replaces built-in `m{a-z}` mark setting) ### 📖 Status Line diff --git a/init.lua b/init.lua index a2564b8..670dbf0 100644 --- a/init.lua +++ b/init.lua @@ -2,7 +2,6 @@ require("mappings") require("options") require("autocommands") require("config.lazy") -require("health") if vim.fn.has("mac") == 1 then require("config.mac") diff --git a/lua/autocommands.lua b/lua/autocommands.lua index 16f3138..daa29d9 100644 --- a/lua/autocommands.lua +++ b/lua/autocommands.lua @@ -1,7 +1,7 @@ vim.api.nvim_set_hl(0, "YankHighlight", { bg = "#2d3f5f" }) vim.api.nvim_create_autocmd("TextYankPost", { callback = function() - vim.highlight.on_yank { higroup = "YankHighlight", timeout = 250 } + vim.hl.on_yank { higroup = "YankHighlight", timeout = 250 } end, group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }), pattern = "*", diff --git a/lua/health.lua b/lua/health/nvim.lua similarity index 100% rename from lua/health.lua rename to lua/health/nvim.lua diff --git a/lua/language-servers/lua-language-server.lua b/lua/language-servers/lua-language-server.lua index 0c463c3..e9d27a5 100644 --- a/lua/language-servers/lua-language-server.lua +++ b/lua/language-servers/lua-language-server.lua @@ -4,6 +4,10 @@ vim.lsp.config("lua_ls", { diagnostics = { globals = { "vim" }, }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + }, telemetry = { enable = false }, }, }, diff --git a/lua/mappings.lua b/lua/mappings.lua index 66ac97b..8964816 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -8,10 +8,6 @@ map("", "", "", { remap = true }) map("n", ";", ":") map("v", ";", ":") --- easier than reaching for escape -map("i", "", "") -map("v", "", "") - -- navigate tabs map("n", "", "gT") map("n", "", "gt") @@ -33,8 +29,8 @@ map("x", "", "gc", { remap = true }) map("n", "h", "nohlsearch") -- diagnostics -map("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous [D]iagnostic message" }) -map("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next [D]iagnostic message" }) +map("n", "[d", function() vim.diagnostic.jump({ count = -1, float = true }) end, { desc = "Go to previous [D]iagnostic message" }) +map("n", "]d", function() vim.diagnostic.jump({ count = 1, float = true }) end, { desc = "Go to next [D]iagnostic message" }) -- toggle diff mode local function toggle_diff() diff --git a/lua/plugins/claudecode.lua b/lua/plugins/claudecode.lua index d8af4a9..34a4615 100644 --- a/lua/plugins/claudecode.lua +++ b/lua/plugins/claudecode.lua @@ -1,5 +1,5 @@ return { - "qwrtln/claudecode.nvim", + url = "git@github.com:qwrtln/claudecode.nvim.git", dependencies = { "folke/snacks.nvim" }, config = true, opts = { diff --git a/lua/plugins/claudecode.rs b/lua/plugins/claudecode.rs deleted file mode 100644 index a2ec49b..0000000 --- a/lua/plugins/claudecode.rs +++ /dev/null @@ -1,34 +0,0 @@ -struct Key { - lhs: &'static str, - rhs: Option<&'static str>, - desc: &'static str, - mode: Option<&'static str>, - ft: Option<&'static [&'static str]>, -} - -struct Plugin { - name: &'static str, - dependencies: &'static [&'static str], - config: bool, - keys: &'static [Key], -} - -const CLAUDE_CODE: Plugin = Plugin { - name: "coder/claudecode.nvim", - dependencies: &["folke/snacks.nvim"], - config: true, - keys: &[ - Key { lhs: "a", rhs: None, desc: "AI/Claude Code", mode: None, ft: None }, - Key { lhs: "ac", rhs: Some("ClaudeCode"), desc: "Toggle Claude", mode: None, ft: None }, - Key { lhs: "af", rhs: Some("ClaudeCodeFocus"), desc: "Focus Claude", mode: None, ft: None }, - Key { lhs: "ar", rhs: Some("ClaudeCode --resume"), desc: "Resume Claude", mode: None, ft: None }, - Key { lhs: "aC", rhs: Some("ClaudeCode --continue"), desc: "Continue Claude", mode: None, ft: None }, - Key { lhs: "am", rhs: Some("ClaudeCodeSelectModel"), desc: "Select Claude model", mode: None, ft: None }, - Key { lhs: "ab", rhs: Some("ClaudeCodeAdd %"), desc: "Add current buffer", mode: None, ft: None }, - Key { lhs: "as", rhs: Some("ClaudeCodeSend"), desc: "Send to Claude", mode: Some("v"), ft: None }, - Key { lhs: "as", rhs: Some("ClaudeCodeTreeAdd"), desc: "Add file", mode: None, ft: Some(&["NvimTree", "neo-tree", "oil", "minifiles", "netrw"]) }, - // Diff management - Key { lhs: "aa", rhs: Some("ClaudeCodeDiffAccept"), desc: "Accept diff", mode: None, ft: None }, - Key { lhs: "ad", rhs: Some("ClaudeCodeDiffDeny"), desc: "Deny diff", mode: None, ft: None }, - ], -}; diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 35e7e20..80874b2 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -16,17 +16,6 @@ vim.api.nvim_create_autocmd("FileType", { end, }) -vim.api.nvim_create_autocmd("CmdlineEnter", { - callback = function() - require("cmp").setup { enabled = false } - end, -}) - -vim.api.nvim_create_autocmd("CmdlineLeave", { - callback = function() - require("cmp").setup { enabled = true } - end, -}) return { "hrsh7th/nvim-cmp", @@ -142,23 +131,22 @@ return { }, sorting = { priority_weight = 1.0, + comparators = { + compare.offset, + compare.exact, + compare.recently_used, + function(entry1, entry2) -- sort by compare kind (Variable, Function etc) + local kind1 = modified_kind(entry1:get_kind()) + local kind2 = modified_kind(entry2:get_kind()) + if kind1 ~= kind2 then + return kind1 - kind2 < 0 + end + end, + compare.score, + require("cmp-under-comparator").under, + compare.kind, + }, }, - comparators = { - compare.offset, - compare.exact, - compare.recently_used, - function(entry1, entry2) -- sort by compare kind (Variable, Function etc) - local kind1 = modified_kind(entry1:get_kind()) - local kind2 = modified_kind(entry2:get_kind()) - if kind1 ~= kind2 then - return kind1 - kind2 < 0 - end - end, - compare.score, - require("cmp-under-comparator").under, - compare.kind, - }, - min_length = 0, -- allow for `from package import _` in Python mapping = cmp.mapping.preset.insert { [""] = cmp.mapping.confirm { select = false }, -- do not select first item [""] = cmp.mapping.abort(), diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua index 5f11a6d..1ffe63e 100644 --- a/lua/plugins/indent-blankline.lua +++ b/lua/plugins/indent-blankline.lua @@ -6,7 +6,7 @@ return { ---@type ibl.config opts = { scope = { - highlight = "IndentBlanklineScpe", + highlight = "IndentBlanklineScope", }, }, } diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index f4be675..f334408 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -24,6 +24,7 @@ vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { vim.diagnostic.open_float(nil, { border = "rounded", focus = false, + scope = "cursor", }) end, }) diff --git a/lua/plugins/neoscroll.lua b/lua/plugins/neoscroll.lua index fbc7258..a34ad09 100644 --- a/lua/plugins/neoscroll.lua +++ b/lua/plugins/neoscroll.lua @@ -2,6 +2,5 @@ return { "karb94/neoscroll.nvim", opts = { easing = "sine", - ignored_events = {}, }, } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 2b10214..0e2bc7c 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,5 +1,5 @@ local map = vim.keymap.set -local projects_root_path = "~/Workspace" +local projects_root_path = vim.g.projects_root or "~/Workspace" map("n", "f", "Telescope find_files") map("n", "g", "Telescope live_grep") diff --git a/lua/plugins/tokyonight.lua b/lua/plugins/tokyonight.lua index 046cd2f..816860b 100644 --- a/lua/plugins/tokyonight.lua +++ b/lua/plugins/tokyonight.lua @@ -19,6 +19,6 @@ return { highlight(0, "LineNrAbove", { fg = "#5a5a5a", bold = false }) highlight(0, "LineNr", { fg = "#71797E", bold = true }) highlight(0, "LineNrBelow", { fg = "#5a5a5a", bold = false }) - highlight(0, "IndentBlanklineScpe", { fg = "#606060" }) + highlight(0, "IndentBlanklineScope", { fg = "#606060" }) end, } diff --git a/lua/plugins/treesitter-textobjects.lua b/lua/plugins/treesitter-textobjects.lua index 870b5ab..1740da6 100644 --- a/lua/plugins/treesitter-textobjects.lua +++ b/lua/plugins/treesitter-textobjects.lua @@ -29,14 +29,6 @@ return { select("@function.inner", "textobjects") end, { desc = "Select inside function" }) - -- Classes - map({ "x", "o" }, "ac", function() - select("@class.outer", "textobjects") - end, { desc = "Select around class" }) - map({ "x", "o" }, "ic", function() - select("@class.inner", "textobjects") - end, { desc = "Select inside class" }) - -- Parameters map({ "x", "o" }, "ap", function() select("@parameter.outer", "textobjects") @@ -129,14 +121,6 @@ return { move.goto_previous_end("@class.outer", "textobjects") end, { desc = "Previous class end" }) - -- Jump to next/previous parameter - map({ "n", "x", "o" }, "]a", function() - move.goto_next_start("@parameter.inner", "textobjects") - end, { desc = "Next parameter" }) - map({ "n", "x", "o" }, "[a", function() - move.goto_previous_start("@parameter.inner", "textobjects") - end, { desc = "Previous parameter" }) - -- Jump to next/previous assignment map({ "n", "x", "o" }, "]a", function() move.goto_next_start("@assignment.outer", "textobjects") From 95883e5c4a64903f3217f738c8df98b2cebd5ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Wi=C4=85cek?= Date: Sat, 23 May 2026 01:22:12 +0200 Subject: [PATCH 2/3] Stylua fixes --- lua/mappings.lua | 8 ++++++-- lua/plugins/cmp.lua | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/mappings.lua b/lua/mappings.lua index 8964816..81a4c71 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -29,8 +29,12 @@ map("x", "", "gc", { remap = true }) map("n", "h", "nohlsearch") -- diagnostics -map("n", "[d", function() vim.diagnostic.jump({ count = -1, float = true }) end, { desc = "Go to previous [D]iagnostic message" }) -map("n", "]d", function() vim.diagnostic.jump({ count = 1, float = true }) end, { desc = "Go to next [D]iagnostic message" }) +map("n", "[d", function() + vim.diagnostic.jump { count = -1, float = true } +end, { desc = "Go to previous [D]iagnostic message" }) +map("n", "]d", function() + vim.diagnostic.jump { count = 1, float = true } +end, { desc = "Go to next [D]iagnostic message" }) -- toggle diff mode local function toggle_diff() diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 80874b2..d6b2a59 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -16,7 +16,6 @@ vim.api.nvim_create_autocmd("FileType", { end, }) - return { "hrsh7th/nvim-cmp", event = { "BufEnter", "BufReadPre", "BufNewFile" }, From 9ec9aaa6553ee05901081d4c4b6d4aa8445c0517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Wi=C4=85cek?= Date: Fri, 29 May 2026 22:28:46 +0200 Subject: [PATCH 3/3] Complete after at least 3 characters --- lua/plugins/cmp.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index d6b2a59..01cce33 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -185,6 +185,7 @@ return { -- `:` cmdline setup. cmp.setup.cmdline(":", { + completion = { keyword_length = 3 }, mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = "path" },