Skip to main content

Sidekick

info

You can enable the extra with the :LazyExtras command. Plugins marked as optional will only be configured if they are installed.

Below you can find a list of included plugins and their default settings.

caution

You don't need to copy the default settings to your config. They are only shown here for reference.

nvim-lspconfig

copilot-language-server

opts = function(_, opts)
local sk = LazyVim.opts("sidekick.nvim") ---@type sidekick.Config|{}
if vim.tbl_get(sk, "nes", "enabled") ~= false then
opts.servers = opts.servers or {}
opts.servers.copilot = opts.servers.copilot or {}
end
end

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
Snacks.toggle({
name = "Sidekick NES",
get = function()
return require("sidekick.nes").enabled
end,
set = function(state)
require("sidekick.nes").enable(state)
end,
}):map("<leader>uN")
end

lualine.nvim (optional)

lualine

opts = function(_, opts)
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()
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,
})

table.insert(opts.sections.lualine_x, 2, {
function()
local status = require("sidekick.status").cli()
return " " .. (#status > 1 and #status or "")
end,
cond = function()
return #require("sidekick.status").cli() > 0
end,
color = function()
return { fg = Snacks.util.color("Special") }
end,
})
end

snacks.nvim (optional)

opts = {
picker = {
actions = {
sidekick_send = function(...)
return require("sidekick.cli.picker.snacks").send(...)
end,
},
win = {
input = {
keys = {
["<a-a>"] = {
"sidekick_send",
mode = { "n", "i" },
},
},
},
},
},
}