From ed637bb0f7f418de069a4d5a7ed8a7b3b93eb425 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 26 Sep 2025 12:14:33 +0200 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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[] From dbfe20996ce62d6b0048245ab4e304610548da04 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 27 Sep 2025 18:41:34 +0200 Subject: [PATCH 6/9] feat(extras): added extra for `sidekick.nvim` (Copilot LSP integration) --- lua/lazyvim/plugins/extras/ai/sidekick.lua | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/ai/sidekick.lua diff --git a/lua/lazyvim/plugins/extras/ai/sidekick.lua b/lua/lazyvim/plugins/extras/ai/sidekick.lua new file mode 100644 index 00000000..54974b6e --- /dev/null +++ b/lua/lazyvim/plugins/extras/ai/sidekick.lua @@ -0,0 +1,49 @@ +return { + desc = "Next edit suggestions with the Copilot LSP server", + + -- copilot-language-server + { + "neovim/nvim-lspconfig", + opts = { + servers = { + copilot = {}, + }, + }, + }, + + -- lualine + { + "nvim-lualine/lualine.nvim", + optional = true, + event = "VeryLazy", + opts = function(_, opts) + table.insert( + opts.sections.lualine_x, + 2, + LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function() + local status = require("sidekick.status").get() + if status then + return status.kind == "Error" and "error" or status.busy and "pending" or "ok" + end + end) + ) + end, + }, + + { + "folke/sidekick.nvim", + opts = function() + -- Accept inline suggestions or next edits + LazyVim.cmp.actions.ai_nes = function() + local Nes = require("sidekick.nes") + if Nes.have() and (Nes.jump() or Nes.apply()) then + return true + end + end + end, + keys = { + -- nes is also useful in normal mode + { "", LazyVim.cmp.map({ "ai_nes" }, ""), mode = { "n" }, expr = true }, + }, + }, +} From eee364552e8afb893f4b3f47b9c0582ca390878b Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sat, 27 Sep 2025 16:42:47 +0000 Subject: [PATCH 7/9] 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 8d0a76e9..a071f54a 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 September 26 +*LazyVim.txt* For Neovim Last change: 2025 September 27 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 060e6dfaf7d4157b1a144df7d83179640dc52400 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:54:19 +0200 Subject: [PATCH 8/9] chore(main): release 15.5.0 (#6533) :robot: I have created a release *beep* *boop* --- ## [15.5.0](https://github.com/LazyVim/LazyVim/compare/v15.4.0...v15.5.0) (2025-09-27) ### Features * **ai.copilot-native:** let sidekick.nvim handle some things if available ([b25ea9c](https://github.com/LazyVim/LazyVim/commit/b25ea9c153e76d11579731e1d5529f275a36f91d)) * **ai:** added completion hooks for next edit suggestions ([30a325d](https://github.com/LazyVim/LazyVim/commit/30a325d67184a80006dc55352d9663cdf01082d5)) * **extras:** added extra for `sidekick.nvim` (Copilot LSP integration) ([dbfe209](https://github.com/LazyVim/LazyVim/commit/dbfe20996ce62d6b0048245ab4e304610548da04)) ### Bug Fixes * **ai.copilot:** disable copilot lsp if installed. copilot.lua needs its own version of the LSP ([e9bc607](https://github.com/LazyVim/LazyVim/commit/e9bc6074d1ea69e921a6195d1dc34333eaa310f8)) --- 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 8a820181..46b8d23f 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "15.4.0" + ".": "15.5.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index abe4b7c0..1be2a770 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [15.5.0](https://github.com/LazyVim/LazyVim/compare/v15.4.0...v15.5.0) (2025-09-27) + + +### Features + +* **ai.copilot-native:** let sidekick.nvim handle some things if available ([b25ea9c](https://github.com/LazyVim/LazyVim/commit/b25ea9c153e76d11579731e1d5529f275a36f91d)) +* **ai:** added completion hooks for next edit suggestions ([30a325d](https://github.com/LazyVim/LazyVim/commit/30a325d67184a80006dc55352d9663cdf01082d5)) +* **extras:** added extra for `sidekick.nvim` (Copilot LSP integration) ([dbfe209](https://github.com/LazyVim/LazyVim/commit/dbfe20996ce62d6b0048245ab4e304610548da04)) + + +### Bug Fixes + +* **ai.copilot:** disable copilot lsp if installed. copilot.lua needs its own version of the LSP ([e9bc607](https://github.com/LazyVim/LazyVim/commit/e9bc6074d1ea69e921a6195d1dc34333eaa310f8)) + ## [15.4.0](https://github.com/LazyVim/LazyVim/compare/v15.3.0...v15.4.0) (2025-09-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 39c719cf..fde5e4a6 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.4.0" -- x-release-please-version +M.version = "15.5.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From b8899781516da71ba0f63afa93fb4a6b25dff144 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 27 Sep 2025 19:53:14 +0200 Subject: [PATCH 9/9] feat(sidekick): fancier lualine component --- lua/lazyvim/plugins/extras/ai/sidekick.lua | 28 +++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/sidekick.lua b/lua/lazyvim/plugins/extras/ai/sidekick.lua index 54974b6e..574938f7 100644 --- a/lua/lazyvim/plugins/extras/ai/sidekick.lua +++ b/lua/lazyvim/plugins/extras/ai/sidekick.lua @@ -17,16 +17,26 @@ return { optional = true, event = "VeryLazy", opts = function(_, opts) - table.insert( - opts.sections.lualine_x, - 2, - LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function() + local icons = { + Error = { " ", "DiagnosticError" }, + Inactive = { " ", "MsgArea" }, + Warning = { " ", "DiagnosticWarn" }, + Normal = { LazyVim.config.icons.kinds.Copilot, "Special" }, + } + table.insert(opts.sections.lualine_x, 2, { + function() local status = require("sidekick.status").get() - if status then - return status.kind == "Error" and "error" or status.busy and "pending" or "ok" - end - end) - ) + return status and vim.tbl_get(icons, status.kind, 1) + end, + cond = function() + return require("sidekick.status").get() ~= nil + end, + color = function() + local status = require("sidekick.status").get() + local hl = status and (status.busy and "DiagnosticWarn" or vim.tbl_get(icons, status.kind, 2)) + return { fg = Snacks.util.color(hl) } + end, + }) end, },