feat(extras): added extra for sidekick.nvim (Copilot LSP integration)

This commit is contained in:
Folke Lemaitre
2025-09-27 18:41:34 +02:00
parent 30a325d671
commit dbfe20996c

View File

@@ -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
{ "<tab>", LazyVim.cmp.map({ "ai_nes" }, "<tab>"), mode = { "n" }, expr = true },
},
},
}