mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-03-10 09:27:25 +00:00
feat(extras): added extra for sidekick.nvim (Copilot LSP integration)
This commit is contained in:
49
lua/lazyvim/plugins/extras/ai/sidekick.lua
Normal file
49
lua/lazyvim/plugins/extras/ai/sidekick.lua
Normal 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 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user