From 5985ca0cf1a0c1ddee8b2b718c730f988cec7001 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 25 Sep 2025 07:35:59 +0200 Subject: [PATCH 01/13] fix(treesitter): create buffer-local textobjects keymaps only when available. Closes #6508 --- lua/lazyvim/plugins/treesitter.lua | 74 +++++++++++++++++------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 8ad15924..78f1b3b2 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -128,38 +128,19 @@ return { "nvim-treesitter/nvim-treesitter-textobjects", branch = "main", event = "VeryLazy", - opts = {}, - keys = function() - local moves = { - goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" }, - goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" }, - goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" }, - goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" }, - } - local ret = {} ---@type LazyKeysSpec[] - 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) - 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") - ret[#ret + 1] = { - key, - function() - -- don't use treesitter if in diff mode and the key is one of the c/C keys - if vim.wo.diff and key:find("[cC]") then - return vim.cmd("normal! " .. key) - end - require("nvim-treesitter-textobjects.move")[method](query, "textobjects") - end, - desc = desc, - mode = { "n", "x", "o" }, - silent = true, - } - end - end - return ret - end, + opts = { + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + -- LazyVim extention to create buffer-local keymaps + keys = { + goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" }, + goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" }, + goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" }, + goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" }, + }, + }, + }, config = function(_, opts) local TS = require("nvim-treesitter-textobjects") if not TS.setup then @@ -167,6 +148,35 @@ return { return end TS.setup(opts) + + vim.api.nvim_create_autocmd("FileType", { + group = vim.api.nvim_create_augroup("lazyvim_treesitter_textobjects", { clear = true }), + callback = function(ev) + if not (vim.tbl_get(opts, "move", "enable") and LazyVim.treesitter.have(ev.match, "textobjects")) then + return + end + ---@type table> + local moves = vim.tbl_get(opts, "move", "keys") or {} + + 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) + 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 + vim.keymap.set({ "n", "x", "o" }, key, function() + require("nvim-treesitter-textobjects.move")[method](query, "textobjects") + end, { + buffer = ev.buf, + desc = desc, + silent = true, + }) + end + end + end + end, + }) end, }, From 1d404815f0600b841dcc0d19e0a2e46bb8156f6b Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Thu, 25 Sep 2025 05:37:13 +0000 Subject: [PATCH 02/13] 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 dbeb4819..8e59c6cb 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 September 23 +*LazyVim.txt* For Neovim Last change: 2025 September 25 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3b0296358508da1eb258c8716df163dd04fa6449 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 25 Sep 2025 10:31:16 +0200 Subject: [PATCH 03/13] feat(copilot): added `copilot-native` extra to setup native inline completions in Neovim --- .../plugins/extras/ai/copilot-native.lua | 49 +++++++++++++++++++ lua/lazyvim/util/lualine.lua | 36 ++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/ai/copilot-native.lua diff --git a/lua/lazyvim/plugins/extras/ai/copilot-native.lua b/lua/lazyvim/plugins/extras/ai/copilot-native.lua new file mode 100644 index 00000000..8bcb9bfe --- /dev/null +++ b/lua/lazyvim/plugins/extras/ai/copilot-native.lua @@ -0,0 +1,49 @@ +---@diagnostic disable: missing-fields +if lazyvim_docs then + -- Native inline completions don't support being shown as regular completions + vim.g.ai_cmp = false +end + +if LazyVim.has_extra("ai.copilot-native") then + if not vim.lsp.inline_completion then + LazyVim.error("You need Neovim >= 0.12 to use the `ai.copilot-native` extra.") + return {} + end + if LazyVim.has_extra("ai.copilot") then + LazyVim.error("Please disable the `ai.copilot` extra if you want to use `ai.copilot-native`") + return {} + end +end + +vim.g.ai_cmp = false + +return { + desc = "Native Copilot LSP integration. Requires Neovim >= 0.12", + -- copilot-language-server + { + "neovim/nvim-lspconfig", + opts = { + servers = { + copilot = {}, + }, + setup = { + copilot = function(_, opts) + vim.lsp.inline_completion.enable() + LazyVim.cmp.actions.ai_accept = function() + return vim.lsp.inline_completion.get() + end + end, + }, + }, + }, + + -- lualine + { + "nvim-lualine/lualine.nvim", + optional = true, + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.lsp("copilot")) + end, + }, +} diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index a6aa24f3..af4b55f7 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -22,6 +22,42 @@ function M.status(icon, status) } end +--- Status indicator for LSP server activity +---@param server string +---@param opts? { methods?: string[], icon?: string } +function M.lsp(server, opts) + opts = opts or {} + local methods = opts.methods or { "textDocument/completion", "textDocument/inlineCompletion" } + local pending = {} ---@type table + vim.api.nvim_create_autocmd("LspRequest", { + group = vim.api.nvim_create_augroup("lazyvim.lualine.lsp." .. server, { clear = true }), + callback = function(args) + ---@class LspRequestData + ---@field client_id number + ---@field request { bufnr: number, method: string, type: "pending" | "cancel" | "complete" | string } + ---@field request_id number + local data = args.data + local client = vim.lsp.get_client_by_id(data.client_id) + if client and client.name == server and vim.tbl_contains(methods, data.request.method) then + pending[data.request_id] = data.request.type == "pending" or nil + end + end, + }) + return { + function() + return opts.icon + or LazyVim.config.icons.kinds[server:sub(1, 1):upper() .. server:sub(2)] + or LazyVim.config.icons.diagnostics.Hint + end, + cond = function() + return #vim.lsp.get_clients({ name = server, bufnr = 0 }) > 0 + end, + color = function() + return { fg = Snacks.util.color(vim.tbl_isempty(pending) and "Special" or "DiagnosticWarn") } + end, + } +end + ---@param name string ---@param icon? string function M.cmp_source(name, icon) From 9913e1665d783d9c4407633bc33475d403aff433 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 25 Sep 2025 11:11:40 +0200 Subject: [PATCH 04/13] feat(copilot-native): better lualine status --- .../plugins/extras/ai/copilot-native.lua | 26 ++++++++++++-- lua/lazyvim/util/lualine.lua | 36 ------------------- 2 files changed, 23 insertions(+), 39 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-native.lua b/lua/lazyvim/plugins/extras/ai/copilot-native.lua index 8bcb9bfe..85cd0d30 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-native.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-native.lua @@ -16,6 +16,7 @@ if LazyVim.has_extra("ai.copilot-native") then end vim.g.ai_cmp = false +local status = {} ---@type table return { desc = "Native Copilot LSP integration. Requires Neovim >= 0.12", @@ -24,10 +25,22 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - copilot = {}, + copilot = { + handlers = { + didChangeStatus = function(err, res, ctx) + if err then + return + end + status[ctx.client_id] = res.kind ~= "Normal" and "error" or res.busy and "pending" or "ok" + if res.status == "Error" then + LazyVim.error("Please use `:LspCopilotSignIn` to sign in to Copilot") + end + end, + }, + }, }, setup = { - copilot = function(_, opts) + copilot = function() vim.lsp.inline_completion.enable() LazyVim.cmp.actions.ai_accept = function() return vim.lsp.inline_completion.get() @@ -43,7 +56,14 @@ return { optional = true, event = "VeryLazy", opts = function(_, opts) - table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.lsp("copilot")) + table.insert( + opts.sections.lualine_x, + 2, + LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function() + local clients = vim.lsp.get_clients({ name = "copilot", bufnr = 0 }) + return #clients > 0 and status[clients[1].id] or nil + end) + ) end, }, } diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index af4b55f7..a6aa24f3 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -22,42 +22,6 @@ function M.status(icon, status) } end ---- Status indicator for LSP server activity ----@param server string ----@param opts? { methods?: string[], icon?: string } -function M.lsp(server, opts) - opts = opts or {} - local methods = opts.methods or { "textDocument/completion", "textDocument/inlineCompletion" } - local pending = {} ---@type table - vim.api.nvim_create_autocmd("LspRequest", { - group = vim.api.nvim_create_augroup("lazyvim.lualine.lsp." .. server, { clear = true }), - callback = function(args) - ---@class LspRequestData - ---@field client_id number - ---@field request { bufnr: number, method: string, type: "pending" | "cancel" | "complete" | string } - ---@field request_id number - local data = args.data - local client = vim.lsp.get_client_by_id(data.client_id) - if client and client.name == server and vim.tbl_contains(methods, data.request.method) then - pending[data.request_id] = data.request.type == "pending" or nil - end - end, - }) - return { - function() - return opts.icon - or LazyVim.config.icons.kinds[server:sub(1, 1):upper() .. server:sub(2)] - or LazyVim.config.icons.diagnostics.Hint - end, - cond = function() - return #vim.lsp.get_clients({ name = server, bufnr = 0 }) > 0 - end, - color = function() - return { fg = Snacks.util.color(vim.tbl_isempty(pending) and "Special" or "DiagnosticWarn") } - end, - } -end - ---@param name string ---@param icon? string function M.cmp_source(name, icon) From 6bd630cec6f905665691d593dc5d0fb3d54f560c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 25 Sep 2025 12:30:50 +0200 Subject: [PATCH 05/13] feat(copilot-native): added keymaps to cycle suggestions --- lua/lazyvim/plugins/extras/ai/copilot-native.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-native.lua b/lua/lazyvim/plugins/extras/ai/copilot-native.lua index 85cd0d30..a4c8005b 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-native.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-native.lua @@ -37,6 +37,21 @@ return { end end, }, + -- stylua: ignore + keys = { + { + "", + function() vim.lsp.inline_completion.select({ count = 1 }) end, + desc = "Next Copilot Suggestion", + mode = { "i", "n" }, + }, + { + "", + function() vim.lsp.inline_completion.select({ count = -1 }) end, + desc = "Next Copilot Suggestion", + mode = { "i", "n" }, + }, + }, }, }, setup = { From c83df9e68dd41f5a3f7df5a7048169ee286a7da8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 25 Sep 2025 15:30:28 +0200 Subject: [PATCH 06/13] feat(copilot-native): added experimental support for next edit suggestions. check the docs to enable --- lua/lazyvim/config/keymaps.lua | 1 + .../plugins/extras/ai/copilot-native.lua | 68 ++++++++++++++++++- lua/lazyvim/util/cmp.lua | 1 + 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 938a2333..752aa602 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -49,6 +49,7 @@ map("n", "bD", ":bd", { desc = "Delete Buffer and Window" }) map({ "i", "n", "s" }, "", function() vim.cmd("noh") LazyVim.cmp.actions.snippet_stop() + LazyVim.cmp.actions.ai_stop() return "" end, { expr = true, desc = "Escape and Clear hlsearch" }) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-native.lua b/lua/lazyvim/plugins/extras/ai/copilot-native.lua index a4c8005b..b4a61b20 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-native.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-native.lua @@ -2,6 +2,9 @@ if lazyvim_docs then -- Native inline completions don't support being shown as regular completions vim.g.ai_cmp = false + + -- Set to `true` in your `options.lua` to enable experimental support for Next Edit Suggestions + vim.g.copilot_nes = false end if LazyVim.has_extra("ai.copilot-native") then @@ -57,8 +60,41 @@ return { setup = { copilot = function() vim.lsp.inline_completion.enable() + + -- Only trigger NES updates: + -- * when leaving insert mode + -- * when text is changed (in normal mode) + -- * when accepting a next edit suggestion + local nes_update = Snacks.util.debounce(function() + return vim.g.copilot_nes and require("copilot-lsp.nes").request_nes("copilot") + end, { ms = 100 }) + + vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, { + group = vim.api.nvim_create_augroup("lazyvim.copilot-native.complete", { clear = true }), + callback = nes_update, + }) + + -- Accept inline suggestions or next edits LazyVim.cmp.actions.ai_accept = function() - return vim.lsp.inline_completion.get() + if vim.b.nes_state then + local nes = require("copilot-lsp.nes") + + -- Try to jump to the start of the suggestion edit. + if nes.walk_cursor_start_edit() then + return true + end + + -- apply the pending suggestion and jump to the end of the edit. + if nes.apply_pending_nes() then + nes.walk_cursor_end_edit() + nes_update() -- trigger new nes update after accept + return true + end + end + if vim.lsp.inline_completion.get() then + -- nes_update() -- ensure nes update is triggered after inline completion + return true + end end end, }, @@ -81,4 +117,34 @@ return { ) end, }, + + vim.g.copilot_nes + and { + "copilotlsp-nvim/copilot-lsp", + init = function() + vim.api.nvim_create_autocmd("BufEnter", { + callback = function(ev) + local buf = ev.buf + local client = vim.lsp.get_clients({ name = "copilot", bufnr = buf })[1] + if not client then + return + end + client:notify("textDocument/didFocus", { + textDocument = { + uri = vim.uri_from_bufnr(buf), + }, + }) + end, + }) + + LazyVim.cmp.actions.ai_stop = function() + require("copilot-lsp.nes").clear() + end + end, + keys = { + -- nes is also useful in normal mode + { "", LazyVim.cmp.map({ "ai_accept" }, ""), mode = { "n" }, expr = true }, + }, + } + or nil, } diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 0641c892..2637b0d3 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -18,6 +18,7 @@ M.actions = { vim.snippet.stop() end end, + ai_stop = function() end, } ---@param actions string[] From af6e2505b54270c30145e8f4191b865870537287 Mon Sep 17 00:00:00 2001 From: robin Date: Fri, 26 Sep 2025 06:36:14 +0200 Subject: [PATCH 07/13] fix(catppuccin): follow-up on api change (#6505) ## Description https://github.com/catppuccin/nvim/pull/931 will change the api for accessing the bufferline integration. im making this follow up pr so it wont have to be done through a user :) (sorry about https://github.com/LazyVim/LazyVim/pull/6354) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/colorscheme.lua | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/colorscheme.lua b/lua/lazyvim/plugins/colorscheme.lua index 4c41d492..0e19c87f 100644 --- a/lua/lazyvim/plugins/colorscheme.lua +++ b/lua/lazyvim/plugins/colorscheme.lua @@ -13,6 +13,14 @@ return { lazy = true, name = "catppuccin", opts = { + lsp_styles = { + underlines = { + errors = { "undercurl" }, + hints = { "undercurl" }, + warnings = { "undercurl" }, + information = { "undercurl" }, + }, + }, integrations = { aerial = true, alpha = true, @@ -28,26 +36,14 @@ return { leap = true, lsp_trouble = true, mason = true, - markdown = true, mini = true, - native_lsp = { - enabled = true, - underlines = { - errors = { "undercurl" }, - hints = { "undercurl" }, - warnings = { "undercurl" }, - information = { "undercurl" }, - }, - }, navic = { enabled = true, custom_bg = "lualine" }, neotest = true, neotree = true, noice = true, notify = true, - semantic_tokens = true, snacks = true, telescope = true, - treesitter = true, treesitter_context = true, which_key = true, }, @@ -58,7 +54,7 @@ return { optional = true, opts = function(_, opts) if (vim.g.colors_name or ""):find("catppuccin") then - opts.highlights = require("catppuccin.groups.integrations.bufferline").get_theme() + opts.highlights = require("catppuccin.special.bufferline").get_theme() end end, }, From c467282a8352d9ec067b07a00463d850bb4146b3 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Fri, 26 Sep 2025 04:37:07 +0000 Subject: [PATCH 08/13] 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 8e59c6cb..8d0a76e9 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 September 25 +*LazyVim.txt* For Neovim Last change: 2025 September 26 ============================================================================== Table of Contents *LazyVim-table-of-contents* From ed637bb0f7f418de069a4d5a7ed8a7b3b93eb425 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 26 Sep 2025 12:14:33 +0200 Subject: [PATCH 09/13] feat(copilot-native): removed experimental **nes** support with `copilot_lsp` for now, since it's not the best experience right now --- .../plugins/extras/ai/copilot-native.lua | 61 ------------------- 1 file changed, 61 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-native.lua b/lua/lazyvim/plugins/extras/ai/copilot-native.lua index b4a61b20..71a6a3ae 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-native.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-native.lua @@ -2,9 +2,6 @@ if lazyvim_docs then -- Native inline completions don't support being shown as regular completions vim.g.ai_cmp = false - - -- Set to `true` in your `options.lua` to enable experimental support for Next Edit Suggestions - vim.g.copilot_nes = false end if LazyVim.has_extra("ai.copilot-native") then @@ -61,36 +58,8 @@ return { copilot = function() vim.lsp.inline_completion.enable() - -- Only trigger NES updates: - -- * when leaving insert mode - -- * when text is changed (in normal mode) - -- * when accepting a next edit suggestion - local nes_update = Snacks.util.debounce(function() - return vim.g.copilot_nes and require("copilot-lsp.nes").request_nes("copilot") - end, { ms = 100 }) - - vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, { - group = vim.api.nvim_create_augroup("lazyvim.copilot-native.complete", { clear = true }), - callback = nes_update, - }) - -- Accept inline suggestions or next edits LazyVim.cmp.actions.ai_accept = function() - if vim.b.nes_state then - local nes = require("copilot-lsp.nes") - - -- Try to jump to the start of the suggestion edit. - if nes.walk_cursor_start_edit() then - return true - end - - -- apply the pending suggestion and jump to the end of the edit. - if nes.apply_pending_nes() then - nes.walk_cursor_end_edit() - nes_update() -- trigger new nes update after accept - return true - end - end if vim.lsp.inline_completion.get() then -- nes_update() -- ensure nes update is triggered after inline completion return true @@ -117,34 +86,4 @@ return { ) end, }, - - vim.g.copilot_nes - and { - "copilotlsp-nvim/copilot-lsp", - init = function() - vim.api.nvim_create_autocmd("BufEnter", { - callback = function(ev) - local buf = ev.buf - local client = vim.lsp.get_clients({ name = "copilot", bufnr = buf })[1] - if not client then - return - end - client:notify("textDocument/didFocus", { - textDocument = { - uri = vim.uri_from_bufnr(buf), - }, - }) - end, - }) - - LazyVim.cmp.actions.ai_stop = function() - require("copilot-lsp.nes").clear() - end - end, - keys = { - -- nes is also useful in normal mode - { "", LazyVim.cmp.map({ "ai_accept" }, ""), mode = { "n" }, expr = true }, - }, - } - or nil, } From 92b7fcf7b156600b86952bf6f2c777adc68fd0b8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 12:16:12 +0200 Subject: [PATCH 10/13] chore(main): release 15.4.0 (#6515) :robot: I have created a release *beep* *boop* --- ## [15.4.0](https://github.com/LazyVim/LazyVim/compare/v15.3.0...v15.4.0) (2025-09-26) ### Features * **copilot-native:** added experimental support for next edit suggestions. check the docs to enable ([c83df9e](https://github.com/LazyVim/LazyVim/commit/c83df9e68dd41f5a3f7df5a7048169ee286a7da8)) * **copilot-native:** added keymaps to cycle suggestions ([6bd630c](https://github.com/LazyVim/LazyVim/commit/6bd630cec6f905665691d593dc5d0fb3d54f560c)) * **copilot-native:** better lualine status ([9913e16](https://github.com/LazyVim/LazyVim/commit/9913e1665d783d9c4407633bc33475d403aff433)) * **copilot-native:** removed experimental **nes** support with `copilot_lsp` for now, since it's not the best experience right now ([ed637bb](https://github.com/LazyVim/LazyVim/commit/ed637bb0f7f418de069a4d5a7ed8a7b3b93eb425)) * **copilot:** added `copilot-native` extra to setup native inline completions in Neovim ([3b02963](https://github.com/LazyVim/LazyVim/commit/3b0296358508da1eb258c8716df163dd04fa6449)) ### Bug Fixes * **catppuccin:** follow-up on api change ([#6505](https://github.com/LazyVim/LazyVim/issues/6505)) ([af6e250](https://github.com/LazyVim/LazyVim/commit/af6e2505b54270c30145e8f4191b865870537287)) * **treesitter:** create buffer-local textobjects keymaps only when available. Closes [#6508](https://github.com/LazyVim/LazyVim/issues/6508) ([5985ca0](https://github.com/LazyVim/LazyVim/commit/5985ca0cf1a0c1ddee8b2b718c730f988cec7001)) --- 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 | 17 +++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index b0e2e610..8a820181 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "15.3.0" + ".": "15.4.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b8c6724..abe4b7c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [15.4.0](https://github.com/LazyVim/LazyVim/compare/v15.3.0...v15.4.0) (2025-09-26) + + +### Features + +* **copilot-native:** added experimental support for next edit suggestions. check the docs to enable ([c83df9e](https://github.com/LazyVim/LazyVim/commit/c83df9e68dd41f5a3f7df5a7048169ee286a7da8)) +* **copilot-native:** added keymaps to cycle suggestions ([6bd630c](https://github.com/LazyVim/LazyVim/commit/6bd630cec6f905665691d593dc5d0fb3d54f560c)) +* **copilot-native:** better lualine status ([9913e16](https://github.com/LazyVim/LazyVim/commit/9913e1665d783d9c4407633bc33475d403aff433)) +* **copilot-native:** removed experimental **nes** support with `copilot_lsp` for now, since it's not the best experience right now ([ed637bb](https://github.com/LazyVim/LazyVim/commit/ed637bb0f7f418de069a4d5a7ed8a7b3b93eb425)) +* **copilot:** added `copilot-native` extra to setup native inline completions in Neovim ([3b02963](https://github.com/LazyVim/LazyVim/commit/3b0296358508da1eb258c8716df163dd04fa6449)) + + +### Bug Fixes + +* **catppuccin:** follow-up on api change ([#6505](https://github.com/LazyVim/LazyVim/issues/6505)) ([af6e250](https://github.com/LazyVim/LazyVim/commit/af6e2505b54270c30145e8f4191b865870537287)) +* **treesitter:** create buffer-local textobjects keymaps only when available. Closes [#6508](https://github.com/LazyVim/LazyVim/issues/6508) ([5985ca0](https://github.com/LazyVim/LazyVim/commit/5985ca0cf1a0c1ddee8b2b718c730f988cec7001)) + ## [15.3.0](https://github.com/LazyVim/LazyVim/compare/v15.2.0...v15.3.0) (2025-09-23) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 1d288cd2..39c719cf 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.3.0" -- x-release-please-version +M.version = "15.4.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From e9bc6074d1ea69e921a6195d1dc34333eaa310f8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 26 Sep 2025 15:55:32 +0200 Subject: [PATCH 11/13] fix(ai.copilot): disable copilot lsp if installed. copilot.lua needs its own version of the LSP --- lua/lazyvim/plugins/extras/ai/copilot.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ai/copilot.lua b/lua/lazyvim/plugins/extras/ai/copilot.lua index 7c326499..3b5d2275 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot.lua @@ -25,6 +25,17 @@ return { }, }, + -- copilot-language-server + { + "neovim/nvim-lspconfig", + opts = { + servers = { + -- copilot.lua only works with its own copilot lsp server + copilot = { enabled = false }, + }, + }, + }, + -- add ai_accept action { "zbirenbaum/copilot.lua", From b25ea9c153e76d11579731e1d5529f275a36f91d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 26 Sep 2025 15:56:03 +0200 Subject: [PATCH 12/13] feat(ai.copilot-native): let sidekick.nvim handle some things if available --- .../plugins/extras/ai/copilot-native.lua | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-native.lua b/lua/lazyvim/plugins/extras/ai/copilot-native.lua index 71a6a3ae..310fbd81 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-native.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-native.lua @@ -26,17 +26,6 @@ return { opts = { servers = { copilot = { - handlers = { - didChangeStatus = function(err, res, ctx) - if err then - return - end - status[ctx.client_id] = res.kind ~= "Normal" and "error" or res.busy and "pending" or "ok" - if res.status == "Error" then - LazyVim.error("Please use `:LspCopilotSignIn` to sign in to Copilot") - end - end, - }, -- stylua: ignore keys = { { @@ -57,13 +46,25 @@ return { setup = { copilot = function() vim.lsp.inline_completion.enable() - -- Accept inline suggestions or next edits LazyVim.cmp.actions.ai_accept = function() - if vim.lsp.inline_completion.get() then - -- nes_update() -- ensure nes update is triggered after inline completion - return true - end + return vim.lsp.inline_completion.get() + end + + if not LazyVim.has_extra("ai.sidekick") then + vim.lsp.config("copilot", { + handlers = { + didChangeStatus = function(err, res, ctx) + if err then + return + end + status[ctx.client_id] = res.kind ~= "Normal" and "error" or res.busy and "pending" or "ok" + if res.status == "Error" then + LazyVim.error("Please use `:LspCopilotSignIn` to sign in to Copilot") + end + end, + }, + }) end end, }, @@ -76,6 +77,9 @@ return { optional = true, event = "VeryLazy", opts = function(_, opts) + if LazyVim.has_extra("ai.sidekick") then + return + end table.insert( opts.sections.lualine_x, 2, From 30a325d67184a80006dc55352d9663cdf01082d5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 26 Sep 2025 15:57:00 +0200 Subject: [PATCH 13/13] feat(ai): added completion hooks for next edit suggestions --- lua/lazyvim/config/keymaps.lua | 1 - lua/lazyvim/plugins/extras/coding/blink.lua | 4 ++-- lua/lazyvim/plugins/extras/coding/nvim-cmp.lua | 2 +- lua/lazyvim/util/cmp.lua | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 752aa602..938a2333 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -49,7 +49,6 @@ map("n", "bD", ":bd", { desc = "Delete Buffer and Window" }) map({ "i", "n", "s" }, "", function() vim.cmd("noh") LazyVim.cmp.actions.snippet_stop() - LazyVim.cmp.actions.ai_stop() return "" end, { expr = true, desc = "Escape and Clear hlsearch" }) diff --git a/lua/lazyvim/plugins/extras/coding/blink.lua b/lua/lazyvim/plugins/extras/coding/blink.lua index 207b1940..790808b1 100644 --- a/lua/lazyvim/plugins/extras/coding/blink.lua +++ b/lua/lazyvim/plugins/extras/coding/blink.lua @@ -122,12 +122,12 @@ return { if opts.keymap.preset == "super-tab" then -- super-tab opts.keymap[""] = { require("blink.cmp.keymap.presets").get("super-tab")[""][1], - LazyVim.cmp.map({ "snippet_forward", "ai_accept" }), + LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }), "fallback", } else -- other presets opts.keymap[""] = { - LazyVim.cmp.map({ "snippet_forward", "ai_accept" }), + LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }), "fallback", } end diff --git a/lua/lazyvim/plugins/extras/coding/nvim-cmp.lua b/lua/lazyvim/plugins/extras/coding/nvim-cmp.lua index 54bfbf7c..fab56250 100644 --- a/lua/lazyvim/plugins/extras/coding/nvim-cmp.lua +++ b/lua/lazyvim/plugins/extras/coding/nvim-cmp.lua @@ -52,7 +52,7 @@ return { fallback() end, [""] = function(fallback) - return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)() + return LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }, fallback)() end, }), sources = cmp.config.sources({ diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 2637b0d3..0641c892 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -18,7 +18,6 @@ M.actions = { vim.snippet.stop() end end, - ai_stop = function() end, } ---@param actions string[]