From 231e476ec9292b56258f86e28773843cddaf34b8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 24 Oct 2025 06:06:38 +0200 Subject: [PATCH 01/18] fix(chezmoi): use vim.env.HOME instead of os.getenv("HOME") for Windows compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vim.env.HOME works correctly on Windows where the HOME environment variable may not be set, while os.getenv("HOME") returns nil in such cases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- lua/lazyvim/plugins/extras/util/chezmoi.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua index ff4501db..201288a4 100644 --- a/lua/lazyvim/plugins/extras/util/chezmoi.lua +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -5,10 +5,15 @@ local pick_chezmoi = function() local fzf_lua = require("fzf-lua") local actions = { ["enter"] = function(selected) - fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") }) + fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = vim.env.HOME }) end, } - fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions, hidden = false }) + fzf_lua.files({ + cmd = "chezmoi managed --include=files,symlinks", + actions = actions, + cwd = vim.env.HOME, + hidden = false, + }) elseif LazyVim.pick.picker.name == "snacks" then local results = require("chezmoi.commands").list({ args = { @@ -50,7 +55,7 @@ return { "alker0/chezmoi.vim", init = function() vim.g["chezmoi#use_tmp_buffer"] = 1 - vim.g["chezmoi#source_dir_path"] = os.getenv("HOME") .. "/.local/share/chezmoi" + vim.g["chezmoi#source_dir_path"] = vim.env.HOME .. "/.local/share/chezmoi" end, }, { @@ -80,7 +85,7 @@ return { init = function() -- run chezmoi edit on file enter vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { - pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" }, + pattern = { vim.env.HOME .. "/.local/share/chezmoi/*" }, callback = function() vim.schedule(require("chezmoi.commands.__edit").watch) end, From 28aa8feaf7d50bc70e70c7301b9b15b2b567b5d0 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Fri, 24 Oct 2025 04:08:18 +0000 Subject: [PATCH 02/18] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 61b193ba..8da45bff 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 October 23 +*LazyVim.txt* For Neovim Last change: 2025 October 24 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 4796fb4ac54744b69a45a6044655543b1c4231f0 Mon Sep 17 00:00:00 2001 From: denisu14 <56963235+denisu14@users.noreply.github.com> Date: Fri, 24 Oct 2025 02:12:11 -0400 Subject: [PATCH 03/18] fix(lang.ember): remove '.git' lang.ember (#6685) ## Description Removed ".git" from the recommended section of lang.ember so lang.ember isn't recommended for every git directory. ## Related Issue(s) None ## Screenshots image ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/ember.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/ember.lua b/lua/lazyvim/plugins/extras/lang/ember.lua index d16ea82d..ac597bde 100644 --- a/lua/lazyvim/plugins/extras/lang/ember.lua +++ b/lua/lazyvim/plugins/extras/lang/ember.lua @@ -2,7 +2,7 @@ return { recommended = function() return LazyVim.extras.wants({ ft = { "handlebars", "typescript", "javascript", "typescript.glimmer", "javascript.glimmer" }, - root = { "ember-cli-build.js", ".git" }, + root = { "ember-cli-build.js" }, }) end, { From 46e419d27efb5b7282a5ab17a49f4745ce23b55a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 24 Oct 2025 15:35:49 -0700 Subject: [PATCH 04/18] fix(root): don't use fs_realpath on windows --- lua/lazyvim/util/root.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index b3d68721..9ce96141 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -78,7 +78,7 @@ function M.realpath(path) if path == "" or path == nil then return nil end - path = vim.uv.fs_realpath(path) or path + path = vim.fn.has("win32") == 0 and vim.uv.fs_realpath(path) or path return LazyVim.norm(path) end From 84ca4dffdbf175a5e7bc39904157700854d8b2ad Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 25 Oct 2025 07:57:37 +0200 Subject: [PATCH 05/18] feat(sidekick): added NES toggle `uN`. Closes #6692 --- lua/lazyvim/plugins/extras/ai/sidekick.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ai/sidekick.lua b/lua/lazyvim/plugins/extras/ai/sidekick.lua index c1c38c58..d9c0c2e2 100644 --- a/lua/lazyvim/plugins/extras/ai/sidekick.lua +++ b/lua/lazyvim/plugins/extras/ai/sidekick.lua @@ -65,6 +65,15 @@ return { return true end end + Snacks.toggle({ + name = "Sidekick NES", + get = function() + return require("sidekick.nes").enabled + end, + set = function(state) + require("sidekick.nes").enable(state) + end, + }):map("uN") end, -- stylua: ignore keys = { From f581de801319f07b296426a91a3f204d0cfd9f4c Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sat, 25 Oct 2025 05:59:28 +0000 Subject: [PATCH 06/18] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 8da45bff..aaffe254 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 October 24 +*LazyVim.txt* For Neovim Last change: 2025 October 25 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 39644330624139dddb857ed833987c1cfd8432cf Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 25 Oct 2025 16:56:19 +0200 Subject: [PATCH 07/18] feat(lsp): refactor lsp code to use `Snacks.util.lsp.on` --- lua/lazyvim/plugins/extras/ai/copilot.lua | 4 +- lua/lazyvim/plugins/extras/editor/navic.lua | 6 +- lua/lazyvim/plugins/extras/lang/angular.lua | 4 +- lua/lazyvim/plugins/extras/lang/go.lua | 4 +- lua/lazyvim/plugins/extras/lang/python.lua | 4 +- .../plugins/extras/lang/typescript.lua | 4 +- lua/lazyvim/plugins/lsp/init.lua | 17 ++-- lua/lazyvim/util/deprecated.lua | 16 +++ lua/lazyvim/util/lsp.lua | 97 ------------------- 9 files changed, 36 insertions(+), 120 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/copilot.lua b/lua/lazyvim/plugins/extras/ai/copilot.lua index 3b5d2275..989d7d4f 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot.lua @@ -85,9 +85,9 @@ return { copilot_cmp.setup(opts) -- attach cmp source whenever copilot attaches -- fixes lazy-loading issues with the copilot cmp source - LazyVim.lsp.on_attach(function() + Snacks.util.lsp.on({ name = "copilot" }, function() copilot_cmp._on_insert_enter({}) - end, "copilot") + end) end, specs = { { diff --git a/lua/lazyvim/plugins/extras/editor/navic.lua b/lua/lazyvim/plugins/extras/editor/navic.lua index 91ec203c..eeac37a7 100644 --- a/lua/lazyvim/plugins/extras/editor/navic.lua +++ b/lua/lazyvim/plugins/extras/editor/navic.lua @@ -7,10 +7,8 @@ return { lazy = true, init = function() vim.g.navic_silence = true - LazyVim.lsp.on_attach(function(client, buffer) - if client:supports_method("textDocument/documentSymbol") then - require("nvim-navic").attach(client, buffer) - end + Snacks.util.lsp.on({ method = "textDocument/documentSymbol" }, function(buffer, client) + require("nvim-navic").attach(client, buffer) end) end, opts = function() diff --git a/lua/lazyvim/plugins/extras/lang/angular.lua b/lua/lazyvim/plugins/extras/lang/angular.lua index d2f7fdee..cbe0252c 100644 --- a/lua/lazyvim/plugins/extras/lang/angular.lua +++ b/lua/lazyvim/plugins/extras/lang/angular.lua @@ -35,10 +35,10 @@ return { }, setup = { angularls = function() - LazyVim.lsp.on_attach(function(client) + Snacks.util.lsp.on({ name = "angularls" }, function(_, client) --HACK: disable angular renaming capability due to duplicate rename popping up client.server_capabilities.renameProvider = false - end, "angularls") + end) end, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index 86f984f5..7098a055 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -55,7 +55,7 @@ return { gopls = function(_, opts) -- workaround for gopls not supporting semanticTokensProvider -- https://github.com/golang/go/issues/54531#issuecomment-1464982242 - LazyVim.lsp.on_attach(function(client, _) + Snacks.util.lsp.on({ name = "gopls" }, function(_, client) if not client.server_capabilities.semanticTokensProvider then local semantic = client.config.capabilities.textDocument.semanticTokens client.server_capabilities.semanticTokensProvider = { @@ -67,7 +67,7 @@ return { range = true, } end - end, "gopls") + end) -- end workaround end, }, diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 7a77cbc6..bfe9e210 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -58,10 +58,10 @@ return { }, setup = { [ruff] = function() - LazyVim.lsp.on_attach(function(client, _) + Snacks.util.lsp.on({ name = ruff }, function(_, client) -- Disable hover in favor of Pyright client.server_capabilities.hoverProvider = false - end, ruff) + end) end, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index c859ff8d..101b83f2 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -154,7 +154,7 @@ return { resolve("vtsls") end - LazyVim.lsp.on_attach(function(client, buffer) + Snacks.util.lsp.on({ name = "vtsls" }, function(buffer, client) client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx) ---@type string, string, lsp.Range local action, uri, range = unpack(command.arguments) @@ -203,7 +203,7 @@ return { end) end) end - end, "vtsls") + end) -- copy typescript settings to javascript opts.settings.javascript = vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {}) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 5d93c399..9128ba13 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -125,16 +125,15 @@ return { LazyVim.format.register(LazyVim.lsp.formatter()) -- setup keymaps - LazyVim.lsp.on_attach(function(client, buffer) - require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) - end) - - LazyVim.lsp.setup() - LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach) + for server, server_opts in pairs(opts.servers) do + if type(server_opts) == "table" and server_opts.keys then + require("lazyvim.plugins.lsp.keymaps").set({ name = server ~= "*" and server or nil }, server_opts.keys) + end + end -- inlay hints if opts.inlay_hints.enabled then - LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer) + Snacks.util.lsp.on({ method = "textDocument/inlayHint" }, function(buffer) if vim.api.nvim_buf_is_valid(buffer) and vim.bo[buffer].buftype == "" @@ -147,7 +146,7 @@ return { -- folds if opts.folds.enabled then - LazyVim.lsp.on_supports_method("textDocument/foldingRange", function(client, buffer) + Snacks.util.lsp.on({ method = "textDocument/foldingRange" }, function() if LazyVim.set_default("foldmethod", "expr") then LazyVim.set_default("foldexpr", "v:lua.vim.lsp.foldexpr()") end @@ -156,7 +155,7 @@ return { -- code lens if opts.codelens.enabled and vim.lsp.codelens then - LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer) + Snacks.util.lsp.on({ method = "textDocument/codeLens" }, function(buffer) vim.lsp.codelens.refresh() vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { buffer = buffer, diff --git a/lua/lazyvim/util/deprecated.lua b/lua/lazyvim/util/deprecated.lua index 3aad7318..49e24d68 100644 --- a/lua/lazyvim/util/deprecated.lua +++ b/lua/lazyvim/util/deprecated.lua @@ -6,6 +6,22 @@ M.moved = { rename_file = { "Snacks.rename.rename_file" }, on_rename = { "Snacks.rename.on_rename_file" }, words = { "Snacks.words" }, + on_supports_method = { + "Snacks.util.lsp.on", + fn = function(method, cb) + return Snacks.util.lsp.on({ method = method }, function(buffer, client) + cb(client, buffer) + end) + end, + }, + on_attach = { + "Snacks.util.lsp.on", + fn = function(cb, name) + return Snacks.util.lsp.on({ name = name }, function(buffer, client) + cb(client, buffer) + end) + end, + }, }, terminal = { open = { "Snacks.terminal" }, diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index a857422f..90a6a3c7 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -1,103 +1,6 @@ ---@class lazyvim.util.lsp local M = {} ----@param on_attach fun(client:vim.lsp.Client, buffer) ----@param name? string -function M.on_attach(on_attach, name) - return vim.api.nvim_create_autocmd("LspAttach", { - callback = function(args) - local buffer = args.buf ---@type number - local client = vim.lsp.get_client_by_id(args.data.client_id) - if client and (not name or client.name == name) then - return on_attach(client, buffer) - end - end, - }) -end - ----@type table>> -M._supports_method = {} - -function M.setup() - local register_capability = vim.lsp.handlers["client/registerCapability"] - vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) - ---@diagnostic disable-next-line: no-unknown - local ret = register_capability(err, res, ctx) - local client = vim.lsp.get_client_by_id(ctx.client_id) - if client then - for buffer in pairs(client.attached_buffers) do - vim.api.nvim_exec_autocmds("User", { - pattern = "LspDynamicCapability", - data = { client_id = client.id, buffer = buffer }, - }) - end - end - return ret - end - M.on_attach(M._check_methods) - M.on_dynamic_capability(M._check_methods) -end - ----@param client vim.lsp.Client -function M._check_methods(client, buffer) - -- don't trigger on invalid buffers - if not vim.api.nvim_buf_is_valid(buffer) then - return - end - -- don't trigger on non-listed buffers - if not vim.bo[buffer].buflisted then - return - end - -- don't trigger on nofile buffers - if vim.bo[buffer].buftype == "nofile" then - return - end - for method, clients in pairs(M._supports_method) do - clients[client] = clients[client] or {} - if not clients[client][buffer] then - if client.supports_method and client:supports_method(method, buffer) then - clients[client][buffer] = true - vim.api.nvim_exec_autocmds("User", { - pattern = "LspSupportsMethod", - data = { client_id = client.id, buffer = buffer, method = method }, - }) - end - end - end -end - ----@param fn fun(client:vim.lsp.Client, buffer):boolean? ----@param opts? {group?: integer} -function M.on_dynamic_capability(fn, opts) - return vim.api.nvim_create_autocmd("User", { - pattern = "LspDynamicCapability", - group = opts and opts.group or nil, - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - local buffer = args.data.buffer ---@type number - if client then - return fn(client, buffer) - end - end, - }) -end - ----@param method string ----@param fn fun(client:vim.lsp.Client, buffer) -function M.on_supports_method(method, fn) - M._supports_method[method] = M._supports_method[method] or setmetatable({}, { __mode = "k" }) - return vim.api.nvim_create_autocmd("User", { - pattern = "LspSupportsMethod", - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - local buffer = args.data.buffer ---@type number - if client and method == args.data.method then - return fn(client, buffer) - end - end, - }) -end - ---@param opts? LazyFormatter| {filter?: (string|vim.lsp.get_clients.Filter)} function M.formatter(opts) opts = opts or {} From cd8c4977a0a8e80750ed6a10992f988f811c6417 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 25 Oct 2025 16:57:16 +0200 Subject: [PATCH 08/18] feat(lsp): lsp keymaps can now be configured with `lsp-config.opts.servers['*'].keys` like for lsp servers --- lua/lazyvim/plugins/extras/editor/fzf.lua | 21 +-- .../plugins/extras/editor/inc-rename.lua | 31 +++-- .../plugins/extras/editor/snacks_picker.lua | 31 +++-- .../plugins/extras/editor/telescope.lua | 23 ++-- lua/lazyvim/plugins/lsp/init.lua | 62 +++++++-- lua/lazyvim/plugins/lsp/keymaps.lua | 129 +++++++----------- lua/lazyvim/util/init.lua | 2 +- 7 files changed, 160 insertions(+), 139 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 46e99ace..8e17c671 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -289,15 +289,16 @@ return { { "neovim/nvim-lspconfig", - opts = function() - local Keys = require("lazyvim.plugins.lsp.keymaps").get() - -- stylua: ignore - vim.list_extend(Keys, { - { "gd", "FzfLua lsp_definitions jump1=true ignore_current_line=true", desc = "Goto Definition", has = "definition" }, - { "gr", "FzfLua lsp_references jump1=true ignore_current_line=true", desc = "References", nowait = true }, - { "gI", "FzfLua lsp_implementations jump1=true ignore_current_line=true", desc = "Goto Implementation" }, - { "gy", "FzfLua lsp_typedefs jump1=true ignore_current_line=true", desc = "Goto T[y]pe Definition" }, - }) - end, + opts = { + servers = { + -- stylua: ignore + ["*"] = { + { "gd", "FzfLua lsp_definitions jump1=true ignore_current_line=true", desc = "Goto Definition", has = "definition" }, + { "gr", "FzfLua lsp_references jump1=true ignore_current_line=true", desc = "References", nowait = true }, + { "gI", "FzfLua lsp_implementations jump1=true ignore_current_line=true", desc = "Goto Implementation" }, + { "gy", "FzfLua lsp_typedefs jump1=true ignore_current_line=true", desc = "Goto T[y]pe Definition" }, + }, + }, + }, }, } diff --git a/lua/lazyvim/plugins/extras/editor/inc-rename.lua b/lua/lazyvim/plugins/extras/editor/inc-rename.lua index a7c65243..b01f65f3 100644 --- a/lua/lazyvim/plugins/extras/editor/inc-rename.lua +++ b/lua/lazyvim/plugins/extras/editor/inc-rename.lua @@ -12,19 +12,24 @@ return { -- LSP Keymaps { "neovim/nvim-lspconfig", - opts = function() - local keys = require("lazyvim.plugins.lsp.keymaps").get() - keys[#keys + 1] = { - "cr", - function() - local inc_rename = require("inc_rename") - return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("") - end, - expr = true, - desc = "Rename (inc-rename.nvim)", - has = "rename", - } - end, + opts = { + servers = { + ["*"] = { + keys = { + { + "cr", + function() + local inc_rename = require("inc_rename") + return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("") + end, + expr = true, + desc = "Rename (inc-rename.nvim)", + has = "rename", + }, + }, + }, + }, + }, }, --- Noice integration diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 766a9e59..48eea01a 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -135,20 +135,23 @@ return { }, { "neovim/nvim-lspconfig", - opts = function() - local Keys = require("lazyvim.plugins.lsp.keymaps").get() - -- stylua: ignore - vim.list_extend(Keys, { - { "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition", has = "definition" }, - { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, - { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, - { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, - { "ss", function() Snacks.picker.lsp_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Symbols", has = "documentSymbol" }, - { "sS", function() Snacks.picker.lsp_workspace_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Workspace Symbols", has = "workspace/symbols" }, - { "gai", function() Snacks.picker.lsp_incoming_calls() end, desc = "C[a]lls Incoming", has = "callHierarchy/incomingCalls" }, - { "gao", function() Snacks.picker.lsp_outgoing_calls() end, desc = "C[a]lls Outgoing", has = "callHierarchy/outgoingCalls" }, - }) - end, + opts = { + servers = { + ["*"] = { + -- stylua: ignore + keys = { + { "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition", has = "definition" }, + { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, + { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, + { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, + { "ss", function() Snacks.picker.lsp_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Symbols", has = "documentSymbol" }, + { "sS", function() Snacks.picker.lsp_workspace_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Workspace Symbols", has = "workspace/symbols" }, + { "gai", function() Snacks.picker.lsp_incoming_calls() end, desc = "C[a]lls Incoming", has = "callHierarchy/incomingCalls" }, + { "gao", function() Snacks.picker.lsp_outgoing_calls() end, desc = "C[a]lls Outgoing", has = "callHierarchy/outgoingCalls" }, + }, + }, + }, + }, }, { "folke/todo-comments.nvim", diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index 0f5ee474..f8f3ed6a 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -284,15 +284,18 @@ return { { "neovim/nvim-lspconfig", - opts = function() - local Keys = require("lazyvim.plugins.lsp.keymaps").get() - -- stylua: ignore - vim.list_extend(Keys, { - { "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" }, - { "gr", "Telescope lsp_references", desc = "References", nowait = true }, - { "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" }, - { "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" }, - }) - end, + opts = { + servers = { + ["*"] = { + -- stylua: ignore + keys = { + { "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" }, + { "gr", "Telescope lsp_references", desc = "References", nowait = true }, + { "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" }, + { "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" }, + }, + }, + }, + }, }, } diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 9128ba13..eb882c5c 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -7,6 +7,7 @@ return { "mason.nvim", { "mason-org/mason-lspconfig.nvim", config = function() end }, }, + opts_extend = { "servers.*.keys" }, opts = function() ---@class PluginLspOpts local ret = { @@ -51,15 +52,6 @@ return { folds = { enabled = true, }, - -- add any global capabilities here - capabilities = { - workspace = { - fileOperations = { - didRename = true, - willRename = true, - }, - }, - }, -- options for vim.lsp.buf.format -- `bufnr` and `filter` is handled by the LazyVim formatter, -- but can be also overridden when specified @@ -68,9 +60,47 @@ return { timeout_ms = nil, }, -- LSP Server Settings - ---@alias lazyvim.lsp.Config vim.lsp.Config|{mason?:boolean, enabled?:boolean} + -- Sets the default configuration for an LSP client (or all clients if the special name "*" is used). + ---@alias lazyvim.lsp.Config vim.lsp.Config|{mason?:boolean, enabled?:boolean, keys?:LazyKeysLspSpec[]} ---@type table servers = { + -- configuration for all lsp servers + ["*"] = { + capabilities = { + workspace = { + fileOperations = { + didRename = true, + willRename = true, + }, + }, + }, + -- stylua: ignore + keys = { + { "cl", function() Snacks.picker.lsp_config() end, desc = "Lsp Info" }, + { "gd", vim.lsp.buf.definition, desc = "Goto Definition", has = "definition" }, + { "gr", vim.lsp.buf.references, desc = "References", nowait = true }, + { "gI", vim.lsp.buf.implementation, desc = "Goto Implementation" }, + { "gy", vim.lsp.buf.type_definition, desc = "Goto T[y]pe Definition" }, + { "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" }, + { "K", function() return vim.lsp.buf.hover() end, desc = "Hover" }, + { "gK", function() return vim.lsp.buf.signature_help() end, desc = "Signature Help", has = "signatureHelp" }, + { "", function() return vim.lsp.buf.signature_help() end, mode = "i", desc = "Signature Help", has = "signatureHelp" }, + { "ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "x" }, has = "codeAction" }, + { "cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "x" }, has = "codeLens" }, + { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, + { "cR", function() Snacks.rename.rename_file() end, desc = "Rename File", mode ={"n"}, has = { "workspace/didRenameFiles", "workspace/willRenameFiles" } }, + { "cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" }, + { "cA", LazyVim.lsp.action.source, desc = "Source Action", has = "codeAction" }, + { "]]", function() Snacks.words.jump(vim.v.count1) end, has = "documentHighlight", + desc = "Next Reference", cond = function() return Snacks.words.is_enabled() end }, + { "[[", function() Snacks.words.jump(-vim.v.count1) end, has = "documentHighlight", + desc = "Prev Reference", cond = function() return Snacks.words.is_enabled() end }, + { "", function() Snacks.words.jump(vim.v.count1, true) end, has = "documentHighlight", + desc = "Next Reference", cond = function() return Snacks.words.is_enabled() end }, + { "", function() Snacks.words.jump(-vim.v.count1, true) end, has = "documentHighlight", + desc = "Prev Reference", cond = function() return Snacks.words.is_enabled() end }, + }, + }, stylua = { enabled = false }, lua_ls = { -- mason = false, -- set to false if you don't want this server to be installed with mason @@ -179,7 +209,14 @@ return { vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) if opts.capabilities then - vim.lsp.config("*", { capabilities = opts.capabilities }) + LazyVim.deprecate("lsp-config.opts.capabilities", "Use lsp-config.opts.servers['*'].capabilities instead") + opts.servers["*"] = vim.tbl_deep_extend("force", opts.servers["*"] or {}, { + capabilities = opts.capabilities, + }) + end + + if opts.servers["*"] then + vim.lsp.config("*", opts.servers["*"]) end -- get all the servers that are available through mason-lspconfig @@ -191,6 +228,9 @@ return { ---@return boolean? exclude automatic setup local function configure(server) + if server == "*" then + return false + end local sopts = opts.servers[server] sopts = sopts == true and {} or (not sopts) and { enabled = false } or sopts --[[@as lazyvim.lsp.Config]] diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 63be2902..8fe36647 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -1,97 +1,66 @@ local M = {} ---@type LazyKeysLspSpec[]|nil -M._keys = nil +M._keys = {} ---@alias LazyKeysLspSpec LazyKeysSpec|{has?:string|string[], cond?:fun():boolean} ---@alias LazyKeysLsp LazyKeys|{has?:string|string[], cond?:fun():boolean} +---@deprecated ---@return LazyKeysLspSpec[] function M.get() - if M._keys then - return M._keys - end - -- stylua: ignore - M._keys = { - { "cl", function() Snacks.picker.lsp_config() end, desc = "Lsp Info" }, - { "gd", vim.lsp.buf.definition, desc = "Goto Definition", has = "definition" }, - { "gr", vim.lsp.buf.references, desc = "References", nowait = true }, - { "gI", vim.lsp.buf.implementation, desc = "Goto Implementation" }, - { "gy", vim.lsp.buf.type_definition, desc = "Goto T[y]pe Definition" }, - { "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" }, - { "K", function() return vim.lsp.buf.hover() end, desc = "Hover" }, - { "gK", function() return vim.lsp.buf.signature_help() end, desc = "Signature Help", has = "signatureHelp" }, - { "", function() return vim.lsp.buf.signature_help() end, mode = "i", desc = "Signature Help", has = "signatureHelp" }, - { "ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "x" }, has = "codeAction" }, - { "cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "x" }, has = "codeLens" }, - { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, - { "cR", function() Snacks.rename.rename_file() end, desc = "Rename File", mode ={"n"}, has = { "workspace/didRenameFiles", "workspace/willRenameFiles" } }, - { "cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" }, - { "cA", LazyVim.lsp.action.source, desc = "Source Action", has = "codeAction" }, - { "]]", function() Snacks.words.jump(vim.v.count1) end, has = "documentHighlight", - desc = "Next Reference", cond = function() return Snacks.words.is_enabled() end }, - { "[[", function() Snacks.words.jump(-vim.v.count1) end, has = "documentHighlight", - desc = "Prev Reference", cond = function() return Snacks.words.is_enabled() end }, - { "", function() Snacks.words.jump(vim.v.count1, true) end, has = "documentHighlight", - desc = "Next Reference", cond = function() return Snacks.words.is_enabled() end }, - { "", function() Snacks.words.jump(-vim.v.count1, true) end, has = "documentHighlight", - desc = "Prev Reference", cond = function() return Snacks.words.is_enabled() end }, - } - + LazyVim.warn({ + 'Adding LSP keymaps via `require("lazyvim.plugins.lsp.keymaps").get()` is deprecated.', + "Please set keymaps via the `keys` field in the LSP server config.", + [[ +```lua +{ + "neovim/nvim-lspconfig", + opts = { + servers = { + ['*'] = { + keys = { + { "gd", "lua vim.lsp.buf.definition()", has = "definition"}, + }, + }, + }, + }, +} +```]], + }, { stacktrace = true }) + vim.schedule(function() + if #M._keys > 0 then + M.set({}, M._keys) + M._keys = {} + end + end) return M._keys end ----@param method string|string[] -function M.has(buffer, method) - if type(method) == "table" then - for _, m in ipairs(method) do - if M.has(buffer, m) then - return true +---@param filter vim.lsp.get_clients.Filter +---@param spec LazyKeysLspSpec[] +function M.set(filter, spec) + local Keys = require("lazy.core.handler.keys") + for _, keys in pairs(Keys.resolve(spec)) do + ---@cast keys LazyKeysLsp + if keys.cond == nil or keys.cond() then + local filters = {} ---@type vim.lsp.get_clients.Filter[] + if keys.has then + local methods = type(keys.has) == "string" and { keys.has } or keys.has --[[@as string[] ]] + for _, method in ipairs(methods) do + method = method:find("/") and method or ("textDocument/" .. method) + filters[#filters + 1] = vim.tbl_extend("force", vim.deepcopy(filter), { method = method }) + end + else + filters[#filters + 1] = filter end - end - return false - end - method = method:find("/") and method or "textDocument/" .. method - local clients = vim.lsp.get_clients({ bufnr = buffer }) - for _, client in ipairs(clients) do - if client:supports_method(method) then - return true - end - end - return false -end ----@return LazyKeysLsp[] -function M.resolve(buffer) - local Keys = require("lazy.core.handler.keys") - if not Keys.resolve then - return {} - end - local spec = vim.tbl_extend("force", {}, M.get()) - local opts = LazyVim.opts("nvim-lspconfig") - local clients = vim.lsp.get_clients({ bufnr = buffer }) - for _, client in ipairs(clients) do - local maps = opts.servers[client.name] and opts.servers[client.name].keys or {} - vim.list_extend(spec, maps) - end - return Keys.resolve(spec) -end - -function M.on_attach(_, buffer) - local Keys = require("lazy.core.handler.keys") - local keymaps = M.resolve(buffer) - - for _, keys in pairs(keymaps) do - local has = not keys.has or M.has(buffer, keys.has) - local cond = not (keys.cond == false or ((type(keys.cond) == "function") and not keys.cond())) - - if has and cond then - local opts = Keys.opts(keys) - opts.cond = nil - opts.has = nil - opts.silent = opts.silent ~= false - opts.buffer = buffer - vim.keymap.set(keys.mode or "n", keys.lhs, keys.rhs, opts) + for _, f in ipairs(filters) do + local opts = Keys.opts(keys) + ---@cast opts snacks.keymap.set.Opts + opts.lsp = f + Snacks.keymap.set(keys.mode or "n", keys.lhs, keys.rhs, opts) + end end end end diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 812e6f22..be5f91f2 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -221,7 +221,7 @@ function M.safe_keymap_set(mode, lhs, rhs, opts) ---@diagnostic disable-next-line: no-unknown opts.remap = nil end - vim.keymap.set(modes, lhs, rhs, opts) + Snacks.keymap.set(modes, lhs, rhs, opts) end end From acc35382294d91b279b319510b906249a03b2764 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 25 Oct 2025 16:57:40 +0200 Subject: [PATCH 09/18] feat(keymaps): added `r` to run the selection/file with lua --- lua/lazyvim/config/keymaps.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 52bb9e9f..05d07a21 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -207,3 +207,6 @@ map("n", "", "tabnew", { desc = "New Tab" }) map("n", "]", "tabnext", { desc = "Next Tab" }) map("n", "d", "tabclose", { desc = "Close Tab" }) map("n", "[", "tabprevious", { desc = "Previous Tab" }) + +-- lua +map({"n", "x"}, "r", function() Snacks.debug.run() end, { desc = "Run Lua", ft = "lua" }) From 8b8ceb6c878cd9c44dac4b6beb70a7bb82d86c30 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Oct 2025 17:18:21 +0200 Subject: [PATCH 10/18] chore(main): release 15.12.0 (#6677) :robot: I have created a release *beep* *boop* --- ## [15.12.0](https://github.com/LazyVim/LazyVim/compare/v15.11.0...v15.12.0) (2025-10-25) ### Features * **keymaps:** added `r` to run the selection/file with lua ([acc3538](https://github.com/LazyVim/LazyVim/commit/acc35382294d91b279b319510b906249a03b2764)) * **lsp:** lsp keymaps can now be configured with `lsp-config.opts.servers['*'].keys` like for lsp servers ([cd8c497](https://github.com/LazyVim/LazyVim/commit/cd8c4977a0a8e80750ed6a10992f988f811c6417)) * **lsp:** refactor lsp code to use `Snacks.util.lsp.on` ([3964433](https://github.com/LazyVim/LazyVim/commit/39644330624139dddb857ed833987c1cfd8432cf)) * **sidekick:** added NES toggle `uN`. Closes [#6692](https://github.com/LazyVim/LazyVim/issues/6692) ([84ca4df](https://github.com/LazyVim/LazyVim/commit/84ca4dffdbf175a5e7bc39904157700854d8b2ad)) ### Bug Fixes * **chezmoi:** use vim.env.HOME instead of os.getenv("HOME") for Windows compatibility ([231e476](https://github.com/LazyVim/LazyVim/commit/231e476ec9292b56258f86e28773843cddaf34b8)) * **clipboard:** connecting via vscpde's remote-ssh extension causes severe lag during yank and copy operations. ([#6664](https://github.com/LazyVim/LazyVim/issues/6664)) ([5098a69](https://github.com/LazyVim/LazyVim/commit/5098a6987009199d5a5c4bfb8086d0fe4a94e0bb)) * **lang.ember:** remove '.git' lang.ember ([#6685](https://github.com/LazyVim/LazyVim/issues/6685)) ([4796fb4](https://github.com/LazyVim/LazyVim/commit/4796fb4ac54744b69a45a6044655543b1c4231f0)) * **root:** don't use fs_realpath on windows ([46e419d](https://github.com/LazyVim/LazyVim/commit/46e419d27efb5b7282a5ab17a49f4745ce23b55a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 70ffac5e..425d0100 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "15.11.0" + ".": "15.12.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5750eefe..ba1f2867 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [15.12.0](https://github.com/LazyVim/LazyVim/compare/v15.11.0...v15.12.0) (2025-10-25) + + +### Features + +* **keymaps:** added `r` to run the selection/file with lua ([acc3538](https://github.com/LazyVim/LazyVim/commit/acc35382294d91b279b319510b906249a03b2764)) +* **lsp:** lsp keymaps can now be configured with `lsp-config.opts.servers['*'].keys` like for lsp servers ([cd8c497](https://github.com/LazyVim/LazyVim/commit/cd8c4977a0a8e80750ed6a10992f988f811c6417)) +* **lsp:** refactor lsp code to use `Snacks.util.lsp.on` ([3964433](https://github.com/LazyVim/LazyVim/commit/39644330624139dddb857ed833987c1cfd8432cf)) +* **sidekick:** added NES toggle `uN`. Closes [#6692](https://github.com/LazyVim/LazyVim/issues/6692) ([84ca4df](https://github.com/LazyVim/LazyVim/commit/84ca4dffdbf175a5e7bc39904157700854d8b2ad)) + + +### Bug Fixes + +* **chezmoi:** use vim.env.HOME instead of os.getenv("HOME") for Windows compatibility ([231e476](https://github.com/LazyVim/LazyVim/commit/231e476ec9292b56258f86e28773843cddaf34b8)) +* **clipboard:** connecting via vscpde's remote-ssh extension causes severe lag during yank and copy operations. ([#6664](https://github.com/LazyVim/LazyVim/issues/6664)) ([5098a69](https://github.com/LazyVim/LazyVim/commit/5098a6987009199d5a5c4bfb8086d0fe4a94e0bb)) +* **lang.ember:** remove '.git' lang.ember ([#6685](https://github.com/LazyVim/LazyVim/issues/6685)) ([4796fb4](https://github.com/LazyVim/LazyVim/commit/4796fb4ac54744b69a45a6044655543b1c4231f0)) +* **root:** don't use fs_realpath on windows ([46e419d](https://github.com/LazyVim/LazyVim/commit/46e419d27efb5b7282a5ab17a49f4745ce23b55a)) + ## [15.11.0](https://github.com/LazyVim/LazyVim/compare/v15.10.1...v15.11.0) (2025-10-23) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5fc36492..d30ea584 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "15.11.0" -- x-release-please-version +M.version = "15.12.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From b5ea1e9d25202e38a47f0b03ac35cc587c80e6d7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 25 Oct 2025 23:20:52 +0200 Subject: [PATCH 11/18] fix(fzf-lua): LSP keymaps. Closes #6698 --- lua/lazyvim/plugins/extras/editor/fzf.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 8e17c671..f63716c5 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -293,10 +293,12 @@ return { servers = { -- stylua: ignore ["*"] = { - { "gd", "FzfLua lsp_definitions jump1=true ignore_current_line=true", desc = "Goto Definition", has = "definition" }, - { "gr", "FzfLua lsp_references jump1=true ignore_current_line=true", desc = "References", nowait = true }, - { "gI", "FzfLua lsp_implementations jump1=true ignore_current_line=true", desc = "Goto Implementation" }, - { "gy", "FzfLua lsp_typedefs jump1=true ignore_current_line=true", desc = "Goto T[y]pe Definition" }, + keys = { + { "gd", "FzfLua lsp_definitions jump1=true ignore_current_line=true", desc = "Goto Definition", has = "definition" }, + { "gr", "FzfLua lsp_references jump1=true ignore_current_line=true", desc = "References", nowait = true }, + { "gI", "FzfLua lsp_implementations jump1=true ignore_current_line=true", desc = "Goto Implementation" }, + { "gy", "FzfLua lsp_typedefs jump1=true ignore_current_line=true", desc = "Goto T[y]pe Definition" }, + } }, }, }, From d2d0c641ed443f8d2ea9e131ec90df59ea149d0a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 26 Oct 2025 11:58:23 +0100 Subject: [PATCH 12/18] fix(navic): navic attach. Closes #6702 --- lua/lazyvim/plugins/extras/editor/navic.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/navic.lua b/lua/lazyvim/plugins/extras/editor/navic.lua index eeac37a7..806a7bfe 100644 --- a/lua/lazyvim/plugins/extras/editor/navic.lua +++ b/lua/lazyvim/plugins/extras/editor/navic.lua @@ -7,11 +7,11 @@ return { lazy = true, init = function() vim.g.navic_silence = true + end, + opts = function() Snacks.util.lsp.on({ method = "textDocument/documentSymbol" }, function(buffer, client) require("nvim-navic").attach(client, buffer) end) - end, - opts = function() return { separator = " ", highlight = true, From 7831bff9af71a783e7d8dd52f56e9b8477521710 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sun, 26 Oct 2025 10:59:58 +0000 Subject: [PATCH 13/18] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index aaffe254..16c427cd 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 October 25 +*LazyVim.txt* For Neovim Last change: 2025 October 26 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 235cadf4cf5cfc32bb97ea3481221dbecfc30a00 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Oct 2025 12:01:47 +0100 Subject: [PATCH 14/18] chore(main): release 15.12.1 (#6699) :robot: I have created a release *beep* *boop* --- ## [15.12.1](https://github.com/LazyVim/LazyVim/compare/v15.12.0...v15.12.1) (2025-10-26) ### Bug Fixes * **fzf-lua:** LSP keymaps. Closes [#6698](https://github.com/LazyVim/LazyVim/issues/6698) ([b5ea1e9](https://github.com/LazyVim/LazyVim/commit/b5ea1e9d25202e38a47f0b03ac35cc587c80e6d7)) * **navic:** navic attach. Closes [#6702](https://github.com/LazyVim/LazyVim/issues/6702) ([d2d0c64](https://github.com/LazyVim/LazyVim/commit/d2d0c641ed443f8d2ea9e131ec90df59ea149d0a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 425d0100..bc4d0453 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "15.12.0" + ".": "15.12.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index ba1f2867..5b05541c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [15.12.1](https://github.com/LazyVim/LazyVim/compare/v15.12.0...v15.12.1) (2025-10-26) + + +### Bug Fixes + +* **fzf-lua:** LSP keymaps. Closes [#6698](https://github.com/LazyVim/LazyVim/issues/6698) ([b5ea1e9](https://github.com/LazyVim/LazyVim/commit/b5ea1e9d25202e38a47f0b03ac35cc587c80e6d7)) +* **navic:** navic attach. Closes [#6702](https://github.com/LazyVim/LazyVim/issues/6702) ([d2d0c64](https://github.com/LazyVim/LazyVim/commit/d2d0c641ed443f8d2ea9e131ec90df59ea149d0a)) + ## [15.12.0](https://github.com/LazyVim/LazyVim/compare/v15.11.0...v15.12.0) (2025-10-25) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d30ea584..63cdefdf 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "15.12.0" -- x-release-please-version +M.version = "15.12.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 1a401627146c66beaeb213f66dd02662f1006e82 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 26 Oct 2025 12:21:22 +0100 Subject: [PATCH 15/18] fix(lsp.keymaps): make cond -> enabled work again. Closes #6697 --- lua/lazyvim/plugins/lsp/init.lua | 8 +++---- lua/lazyvim/plugins/lsp/keymaps.lua | 35 ++++++++++++++--------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index eb882c5c..540b6c5c 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -92,13 +92,13 @@ return { { "cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" }, { "cA", LazyVim.lsp.action.source, desc = "Source Action", has = "codeAction" }, { "]]", function() Snacks.words.jump(vim.v.count1) end, has = "documentHighlight", - desc = "Next Reference", cond = function() return Snacks.words.is_enabled() end }, + desc = "Next Reference", enabled = function() return Snacks.words.is_enabled() end }, { "[[", function() Snacks.words.jump(-vim.v.count1) end, has = "documentHighlight", - desc = "Prev Reference", cond = function() return Snacks.words.is_enabled() end }, + desc = "Prev Reference", enabled = function() return Snacks.words.is_enabled() end }, { "", function() Snacks.words.jump(vim.v.count1, true) end, has = "documentHighlight", - desc = "Next Reference", cond = function() return Snacks.words.is_enabled() end }, + desc = "Next Reference", enabled = function() return Snacks.words.is_enabled() end }, { "", function() Snacks.words.jump(-vim.v.count1, true) end, has = "documentHighlight", - desc = "Prev Reference", cond = function() return Snacks.words.is_enabled() end }, + desc = "Prev Reference", enabled = function() return Snacks.words.is_enabled() end }, }, }, stylua = { enabled = false }, diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 8fe36647..57280055 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -3,8 +3,8 @@ local M = {} ---@type LazyKeysLspSpec[]|nil M._keys = {} ----@alias LazyKeysLspSpec LazyKeysSpec|{has?:string|string[], cond?:fun():boolean} ----@alias LazyKeysLsp LazyKeys|{has?:string|string[], cond?:fun():boolean} +---@alias LazyKeysLspSpec LazyKeysSpec|{has?:string|string[], enabled?:fun():boolean} +---@alias LazyKeysLsp LazyKeys|{has?:string|string[], enabled?:fun():boolean} ---@deprecated ---@return LazyKeysLspSpec[] @@ -43,24 +43,23 @@ function M.set(filter, spec) local Keys = require("lazy.core.handler.keys") for _, keys in pairs(Keys.resolve(spec)) do ---@cast keys LazyKeysLsp - if keys.cond == nil or keys.cond() then - local filters = {} ---@type vim.lsp.get_clients.Filter[] - if keys.has then - local methods = type(keys.has) == "string" and { keys.has } or keys.has --[[@as string[] ]] - for _, method in ipairs(methods) do - method = method:find("/") and method or ("textDocument/" .. method) - filters[#filters + 1] = vim.tbl_extend("force", vim.deepcopy(filter), { method = method }) - end - else - filters[#filters + 1] = filter + local filters = {} ---@type vim.lsp.get_clients.Filter[] + if keys.has then + local methods = type(keys.has) == "string" and { keys.has } or keys.has --[[@as string[] ]] + for _, method in ipairs(methods) do + method = method:find("/") and method or ("textDocument/" .. method) + filters[#filters + 1] = vim.tbl_extend("force", vim.deepcopy(filter), { method = method }) end + else + filters[#filters + 1] = filter + end - for _, f in ipairs(filters) do - local opts = Keys.opts(keys) - ---@cast opts snacks.keymap.set.Opts - opts.lsp = f - Snacks.keymap.set(keys.mode or "n", keys.lhs, keys.rhs, opts) - end + for _, f in ipairs(filters) do + local opts = Keys.opts(keys) + ---@cast opts snacks.keymap.set.Opts + opts.lsp = f + opts.enabled = keys.enabled + Snacks.keymap.set(keys.mode or "n", keys.lhs, keys.rhs, opts) end end end From d72127eb936f7f05d88d4fc316bc7e89080d69d8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Oct 2025 12:27:05 +0100 Subject: [PATCH 16/18] chore(main): release 15.12.2 (#6703) :robot: I have created a release *beep* *boop* --- ## [15.12.2](https://github.com/LazyVim/LazyVim/compare/v15.12.1...v15.12.2) (2025-10-26) ### Bug Fixes * **lsp.keymaps:** make cond -> enabled work again. Closes [#6697](https://github.com/LazyVim/LazyVim/issues/6697) ([1a40162](https://github.com/LazyVim/LazyVim/commit/1a401627146c66beaeb213f66dd02662f1006e82)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index bc4d0453..350a6875 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "15.12.1" + ".": "15.12.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b05541c..d81a5b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [15.12.2](https://github.com/LazyVim/LazyVim/compare/v15.12.1...v15.12.2) (2025-10-26) + + +### Bug Fixes + +* **lsp.keymaps:** make cond -> enabled work again. Closes [#6697](https://github.com/LazyVim/LazyVim/issues/6697) ([1a40162](https://github.com/LazyVim/LazyVim/commit/1a401627146c66beaeb213f66dd02662f1006e82)) + ## [15.12.1](https://github.com/LazyVim/LazyVim/compare/v15.12.0...v15.12.1) (2025-10-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 63cdefdf..5e56a073 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "15.12.1" -- x-release-please-version +M.version = "15.12.2" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 29fb479522e69971f1e57945b21b373190f4090f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 26 Oct 2025 16:04:43 +0100 Subject: [PATCH 17/18] style: remove some vim.lsp calls during startup --- lua/lazyvim/plugins/extras/ai/copilot-native.lua | 2 +- lua/lazyvim/plugins/init.lua | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-native.lua b/lua/lazyvim/plugins/extras/ai/copilot-native.lua index a93e077a..3c1d0230 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-native.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-native.lua @@ -5,7 +5,7 @@ if lazyvim_docs then end if LazyVim.has_extra("ai.copilot-native") then - if not vim.lsp.inline_completion then + if vim.fn.has("nvim-0.12") == 0 then LazyVim.error("You need Neovim >= 0.12 to use the `ai.copilot-native` extra.") return {} end diff --git a/lua/lazyvim/plugins/init.lua b/lua/lazyvim/plugins/init.lua index 80394371..7797b047 100644 --- a/lua/lazyvim/plugins/init.lua +++ b/lua/lazyvim/plugins/init.lua @@ -7,14 +7,6 @@ if vim.fn.has("nvim-0.11.2") == 0 then vim.fn.getchar() vim.cmd([[quit]]) return {} -elseif not vim.lsp.is_enabled then - vim.schedule(function() - LazyVim.warn({ - "You're using an **old** `nightly` version of **Neovim**", - "Please update to a recent `nightly`,", - "or a stable version (`>= 0.11.2`).", - }) - end) end require("lazyvim.config").init() From cd745b14f84621caa5e9145509e9dd49c5d66f66 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sun, 26 Oct 2025 15:06:24 +0000 Subject: [PATCH 18/18] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 16c427cd..1288f75d 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 October 26 +*LazyVim.txt* LazyVim docs ============================================================================== Table of Contents *LazyVim-table-of-contents*