From b6e48a57fb4ad7a79f24646016926eef68ce3002 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 22 Oct 2025 14:51:34 +0200 Subject: [PATCH 01/31] feat(snacks_picker): added gai/gao keymaps for calls incoming/outgoing --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 591da5ea..1da41376 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -144,6 +144,8 @@ return { { "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, }, From f0a91d9fa5f0cf27d6ba5fac759fa1d4e0df97a3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 23 Oct 2025 09:26:22 +0200 Subject: [PATCH 02/31] feat(snacks.picker): added `gD` to diff against merge base of branch/PR --- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 1da41376..766a9e59 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -73,6 +73,7 @@ return { { "fp", function() Snacks.picker.projects() end, desc = "Projects" }, -- git { "gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" }, + { "gD", function() Snacks.picker.git_diff({ base = "origin" }) end, desc = "Git Diff (origin)" }, { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, { "gS", function() Snacks.picker.git_stash() end, desc = "Git Stash" }, -- Grep From 0b4999a4b514de568a3aa089d5ed0f6298e5bfbb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 23 Oct 2025 09:26:48 +0200 Subject: [PATCH 03/31] docs: added LSP keymap specs to CONTRIBUTING.md --- CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d08a3622..cf3e1616 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,3 +29,21 @@ - Every language extra requires a `recommended` section as part of the extra. Check lspconfig server configurations for the proper filetypes and root directories. Refer to other extras for creating the `recommended` section. + +### Language-Specific Keymaps + +- Use `` for language-specific keymaps (follows Vim/Neovim convention for filetype-specific mappings). +- For LSP servers, define keymaps in the server's `keys` field, not in `on_attach`: + ```lua + servers = { + rust_analyzer = { + keys = { + { "e", function() vim.cmd.RustLsp("expandMacro") end, desc = "Expand Macro" }, + } + } + } + ``` +- LazyVim's LSP system will automatically resolve and apply these keymaps (see `lua/lazyvim/plugins/lsp/keymaps.lua`). +- Don't override standard LSP keymaps (like `K` for hover, `gd` for definition) unless absolutely necessary. +- Use standard `c*` keymaps where they make sense (e.g., `co` for organize imports). +- Refer to the R and Haskell extras for examples of proper `` usage. From 4fd9878dead6453c7c0f0f8971109f85a0768b5f Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Thu, 23 Oct 2025 07:28:03 +0000 Subject: [PATCH 04/31] 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 3064b624..61b193ba 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 October 22 +*LazyVim.txt* For Neovim Last change: 2025 October 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 0329bc0e508eb48f7cee7fe57975c364584f8738 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 11:47:53 +0200 Subject: [PATCH 05/31] chore(main): release 15.11.0 (#6658) :robot: I have created a release *beep* *boop* --- ## [15.11.0](https://github.com/LazyVim/LazyVim/compare/v15.10.1...v15.11.0) (2025-10-23) ### Features * **snacks_picker:** added gai/gao keymaps for calls incoming/outgoing ([b6e48a5](https://github.com/LazyVim/LazyVim/commit/b6e48a57fb4ad7a79f24646016926eef68ce3002)) * **snacks.picker:** added `gD` to diff against merge base of branch/PR ([f0a91d9](https://github.com/LazyVim/LazyVim/commit/f0a91d9fa5f0cf27d6ba5fac759fa1d4e0df97a3)) ### Bug Fixes * **avante:** unset default keymaps ([#6657](https://github.com/LazyVim/LazyVim/issues/6657)) ([e8a1d8b](https://github.com/LazyVim/LazyVim/commit/e8a1d8b6286f82d75e5830de5ea93bd7622cec8c)) * **extras:** remove custom formatter opts for dart/solidity. Closes [#6665](https://github.com/LazyVim/LazyVim/issues/6665) ([b38de4e](https://github.com/LazyVim/LazyVim/commit/b38de4e2fe4ad887cae1604fd9f1fbd230e0118f)) --- 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 | 14 ++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index d40f464a..70ffac5e 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "15.10.1" + ".": "15.11.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index cb35b779..5750eefe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [15.11.0](https://github.com/LazyVim/LazyVim/compare/v15.10.1...v15.11.0) (2025-10-23) + + +### Features + +* **snacks_picker:** added gai/gao keymaps for calls incoming/outgoing ([b6e48a5](https://github.com/LazyVim/LazyVim/commit/b6e48a57fb4ad7a79f24646016926eef68ce3002)) +* **snacks.picker:** added `gD` to diff against merge base of branch/PR ([f0a91d9](https://github.com/LazyVim/LazyVim/commit/f0a91d9fa5f0cf27d6ba5fac759fa1d4e0df97a3)) + + +### Bug Fixes + +* **avante:** unset default keymaps ([#6657](https://github.com/LazyVim/LazyVim/issues/6657)) ([e8a1d8b](https://github.com/LazyVim/LazyVim/commit/e8a1d8b6286f82d75e5830de5ea93bd7622cec8c)) +* **extras:** remove custom formatter opts for dart/solidity. Closes [#6665](https://github.com/LazyVim/LazyVim/issues/6665) ([b38de4e](https://github.com/LazyVim/LazyVim/commit/b38de4e2fe4ad887cae1604fd9f1fbd230e0118f)) + ## [15.10.1](https://github.com/LazyVim/LazyVim/compare/v15.10.0...v15.10.1) (2025-10-20) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 023bc6ec..5fc36492 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.10.1" -- x-release-please-version +M.version = "15.11.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 5098a6987009199d5a5c4bfb8086d0fe4a94e0bb Mon Sep 17 00:00:00 2001 From: narutozxp <41829090+narutozxp@users.noreply.github.com> Date: Thu, 23 Oct 2025 18:04:47 +0800 Subject: [PATCH 06/31] fix(clipboard): connecting via vscpde's remote-ssh extension causes severe lag during yank and copy operations. (#6664) ## Description When connecting to a remote server via VSCode's Remote-SSH extension, the `SSH_TTY` environment variable is not set. Consequently, both the `vscode-neovim` extension (when using the remote Neovim instance) and Neovim launched from VSCode's integrated terminal use the system clipboard, resulting in severe lag. Additionally, the `yanky.nvim` plugin synchronizes with the system clipboard by default, regardless of whether the `clipboard` option is set to an empty string (`""`). This causes similar performance issues as described above. Using the `SSH_CONNECTION` environment variable instead of `SSH_TTY` can effectively resolve this issue. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/options.lua | 2 +- lua/lazyvim/plugins/extras/coding/yanky.lua | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 2ae1b38d..809f5003 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -54,7 +54,7 @@ local opt = vim.opt opt.autowrite = true -- Enable auto write -- only set clipboard if not in ssh, to make sure the OSC 52 -- integration works automatically. -opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard +opt.clipboard = vim.env.SSH_CONNECTION and "" or "unnamedplus" -- Sync with system clipboard opt.completeopt = "menu,menuone,noselect" opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions opt.confirm = true -- Confirm to save changes before exiting modified buffer diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 6285796d..5b43b7df 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -5,6 +5,9 @@ return { desc = "Better Yank/Paste", event = "LazyFile", opts = { + system_clipboard = { + sync_with_ring = not vim.env.SSH_CONNECTION, + }, highlight = { timer = 150 }, }, keys = { From 231e476ec9292b56258f86e28773843cddaf34b8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 24 Oct 2025 06:06:38 +0200 Subject: [PATCH 07/31] 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 08/31] 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 09/31] 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 10/31] 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 11/31] 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 12/31] 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 13/31] 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 14/31] 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 15/31] 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 16/31] 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 17/31] 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 18/31] 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 19/31] 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 20/31] 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 21/31] 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 22/31] 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 23/31] 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 24/31] 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* From 064e61058b6bbaef02a6143662628d105695b8e5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Oct 2025 16:14:16 +0100 Subject: [PATCH 25/31] chore(update): update repository (#6712) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .markdownlint-cli2.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .markdownlint-cli2.yaml diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 00000000..fc2ac02c --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,3 @@ +config: + MD013: false + MD033: false From 6b52a3059e52eed062b6ff3f56e70cffcbf879fe Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 Oct 2025 17:28:02 +0100 Subject: [PATCH 26/31] fix(treesitter): remove node requirement --- lua/lazyvim/util/treesitter.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/util/treesitter.lua b/lua/lazyvim/util/treesitter.lua index e8688a6f..c21908c6 100644 --- a/lua/lazyvim/util/treesitter.lua +++ b/lua/lazyvim/util/treesitter.lua @@ -80,7 +80,6 @@ function M.check() ["C compiler"] = have_cc, tar = have("tar"), curl = have("curl"), - node = have("node"), } local ok = true for _, v in pairs(ret) do From 5e981f9a8cd75eb6f49756e188411037b82b8045 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Nov 2025 13:41:53 +0100 Subject: [PATCH 27/31] feat(snacks): `snacks.gh` integration. Enabled by default, unless the `util.octo` extra is enabled. --- lua/lazyvim/config/init.lua | 4 +++- lua/lazyvim/plugins/extras/editor/snacks_picker.lua | 6 +++++- lua/lazyvim/plugins/extras/util/octo.lua | 10 ++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5e56a073..628e1099 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -34,7 +34,9 @@ local defaults = { dots = "󰇘", }, ft = { - octo = "", + octo = " ", + gh = " ", + ["markdown.gh"] = " ", }, dap = { Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 48eea01a..6220bfdf 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -73,9 +73,13 @@ return { { "fp", function() Snacks.picker.projects() end, desc = "Projects" }, -- git { "gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" }, - { "gD", function() Snacks.picker.git_diff({ base = "origin" }) end, desc = "Git Diff (origin)" }, + { "gD", function() Snacks.picker.git_diff({ base = "origin", group = true }) end, desc = "Git Diff (origin)" }, { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, { "gS", function() Snacks.picker.git_stash() end, desc = "Git Stash" }, + { "gi", function() Snacks.picker.gh_issue() end, desc = "GitHub Issues (open)" }, + { "gI", function() Snacks.picker.gh_issue({ state = "all" }) end, desc = "GitHub Issues (all)" }, + { "gp", function() Snacks.picker.gh_pr() end, desc = "GitHub Pull Requests (open)" }, + { "gP", function() Snacks.picker.gh_pr({ state = "all" }) end, desc = "GitHub Pull Requests (all)" }, -- Grep { "sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, { "sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" }, diff --git a/lua/lazyvim/plugins/extras/util/octo.lua b/lua/lazyvim/plugins/extras/util/octo.lua index d3316f5e..5637b8fd 100644 --- a/lua/lazyvim/plugins/extras/util/octo.lua +++ b/lua/lazyvim/plugins/extras/util/octo.lua @@ -3,6 +3,16 @@ return { -- depends on the git extra for highlighting and auto-completion of github issues/prs { import = "lazyvim.plugins.extras.lang.git" }, + { + "folke/snacks.nvim", + keys = { -- disable conflicting keymaps + { "gi", false }, + { "gI", false }, + { "gp", false }, + { "gP", false }, + }, + }, + -- Octo { "pwntester/octo.nvim", From 28db03f958d58dfff3c647ce28fdc1cb88ac158d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:44:04 +0100 Subject: [PATCH 28/31] chore(main): release 15.13.0 :robot: I have created a release *beep* *boop* --- ## [15.13.0](https://github.com/LazyVim/LazyVim/compare/v15.12.2...v15.13.0) (2025-11-01) ### Features * **snacks:** `snacks.gh` integration. Enabled by default, unless the `util.octo` extra is enabled. ([5e981f9](https://github.com/LazyVim/LazyVim/commit/5e981f9a8cd75eb6f49756e188411037b82b8045)) ### Bug Fixes * **treesitter:** remove node requirement ([6b52a30](https://github.com/LazyVim/LazyVim/commit/6b52a3059e52eed062b6ff3f56e70cffcbf879fe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 350a6875..27277755 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "15.12.2" + ".": "15.13.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index d81a5b74..24045345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [15.13.0](https://github.com/LazyVim/LazyVim/compare/v15.12.2...v15.13.0) (2025-11-01) + + +### Features + +* **snacks:** `snacks.gh` integration. Enabled by default, unless the `util.octo` extra is enabled. ([5e981f9](https://github.com/LazyVim/LazyVim/commit/5e981f9a8cd75eb6f49756e188411037b82b8045)) + + +### Bug Fixes + +* **treesitter:** remove node requirement ([6b52a30](https://github.com/LazyVim/LazyVim/commit/6b52a3059e52eed062b6ff3f56e70cffcbf879fe)) + ## [15.12.2](https://github.com/LazyVim/LazyVim/compare/v15.12.1...v15.12.2) (2025-10-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 628e1099..562a0687 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.2" -- x-release-please-version +M.version = "15.13.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 42c9f7152b9bd1a4f739b115390370c208dc2a55 Mon Sep 17 00:00:00 2001 From: Thomas Vandal Date: Mon, 3 Nov 2025 01:51:07 -0500 Subject: [PATCH 29/31] feat(treesitter): support query table in treesitter-textobjects mappings (#6736) ## Description `treesitter-textobjects` mappings accept a table query (for the "move" mappings, at least, I haven't checked the others). Currently, in LazyVim, using a table causes an error due to the assumption that `query` is a string in the `config` function that creates the keymap description. This PR adds a simple loop to gather the queries from a table and join them with "or" in the description. Here is an example config and the resulting error. Everything works as expected with the PR and string (single) queries still behave as expected. ```lua { "nvim-treesitter/nvim-treesitter-textobjects", opts = { move = { keys = { goto_next_start = { ["]j"] = { "@function.outer", "@class.outer" } }, goto_next_end = { ["]J"] = { "@function.outer", "@class.outer" } }, goto_previous_start = { ["[j"] = { "@function.outer", "@class.outer" } }, goto_previous_end = { ["[J"] = { "@function.outer", "@class.outer" } }, }, }, }, } ``` ```lua Failed to run `config` for nvim-treesitter-textobjects ...vim-local/opt/LazyVim/lua/lazyvim/plugins/treesitter.lua:174: attempt to call method 'gsub' (a nil value) # stacktrace: - repos/nvim-local/opt/LazyVim/lua/lazyvim/plugins/treesitter.lua:174 - vim/shared.lua:0 _in_ **tbl_map** - repos/nvim-local/opt/LazyVim/lua/lazyvim/plugins/treesitter.lua:197 _in_ **config** ``` ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/treesitter.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 7fee6c38..4497ff1c 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -171,8 +171,14 @@ return { for method, keymaps in pairs(moves) do for key, query in pairs(keymaps) do - local desc = query:gsub("@", ""):gsub("%..*", "") - desc = desc:sub(1, 1):upper() .. desc:sub(2) + local queries = type(query) == "table" and query or { query } + local parts = {} + for _, q in ipairs(queries) do + local part = q:gsub("@", ""):gsub("%..*", "") + part = part:sub(1, 1):upper() .. part:sub(2) + table.insert(parts, part) + end + local desc = table.concat(parts, " or ") desc = (key:sub(1, 1) == "[" and "Prev " or "Next ") .. desc desc = desc .. (key:sub(2, 2) == key:sub(2, 2):upper() and " End" or " Start") if not (vim.wo.diff and key:find("[cC]")) then From a507822c0f67df661d1411f9274a65ca9cc832f5 Mon Sep 17 00:00:00 2001 From: AK47are <54732151+AK47are@users.noreply.github.com> Date: Thu, 6 Nov 2025 19:40:40 +0800 Subject: [PATCH 30/31] fix(terminal): add -NoProfile to powershell shellcmdflag (#6757) ## Description changing the PowerShell profile might accidentally cause errors in Neovim (see [issue](https://github.com/LazyVim/LazyVim/issues/4805)), which is a subtle bug. Add the `-NoProfile` flag to ensure Neovim is not affected by profile. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/terminal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/terminal.lua b/lua/lazyvim/util/terminal.lua index 0e1af758..4270d9c0 100644 --- a/lua/lazyvim/util/terminal.lua +++ b/lua/lazyvim/util/terminal.lua @@ -18,7 +18,7 @@ function M.setup(shell) -- Setting shell command flags vim.o.shellcmdflag = - "-NoLogo -NonInteractive -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues['Out-File:Encoding']='utf8';$PSStyle.OutputRendering='plaintext';Remove-Alias -Force -ErrorAction SilentlyContinue tee;" + "-NoProfile -NoLogo -NonInteractive -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues['Out-File:Encoding']='utf8';$PSStyle.OutputRendering='plaintext';Remove-Alias -Force -ErrorAction SilentlyContinue tee;" -- Setting shell redirection vim.o.shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode' From c64a61734fc9d45470a72603395c02137802bc6f Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:35:25 +0200 Subject: [PATCH 31/31] fix(terminal): partially revert previous mappings (#6770) ## Description Commit 4efd0e2bea2a387d6fcdea8cf36a62049e8bafed introduced some changes to terminal mappings. I tested in a new LazyVim installation and `sidekick.nvim` is not affected by `` any more. The mappings `hide_underscore` and `hide_slash` don't let user to create new terminals with `2`, `3` and so on. Instead they hide the terminal and user can't open split terminals next to each other any more. Therefore, I believe it would be a better default to revert these 2 mappings explicitly. ## Related Issue(s) None ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/util.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/lazyvim/plugins/util.lua b/lua/lazyvim/plugins/util.lua index 0357c3fb..8d8aa220 100644 --- a/lua/lazyvim/plugins/util.lua +++ b/lua/lazyvim/plugins/util.lua @@ -23,8 +23,6 @@ return { nav_j = { "", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" }, nav_k = { "", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" }, nav_l = { "", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" }, - hide_slash = { "", "hide", desc = "Hide Terminal", mode = { "t", "n" } }, - hide_underscore = { "", "hide", desc = "which_key_ignore", mode = { "t", "n" } }, }, }, },