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
- Options
- Full Spec
opts = {
servers = {
copilot = {},
},
}
{
"neovim/nvim-lspconfig",
opts = {
servers = {
copilot = {},
},
},
}
sidekick.nvim
- Options
- Full Spec
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
{
"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,
-- stylua: ignore
keys = {
-- nes is also useful in normal mode
{ "<tab>", LazyVim.cmp.map({ "ai_nes" }, "<tab>"), mode = { "n" }, expr = true },
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
{
"<c-.>",
function() require("sidekick.cli").toggle() end,
desc = "Sidekick Toggle",
mode = { "n", "t", "i", "x" },
},
{
"<leader>aa",
function() require("sidekick.cli").toggle() end,
desc = "Sidekick Toggle CLI",
},
{
"<leader>as",
function() require("sidekick.cli").select() end,
-- Or to select only installed tools:
-- require("sidekick.cli").select({ filter = { installed = true } })
desc = "Select CLI",
},
{
"<leader>at",
function() require("sidekick.cli").send({ msg = "{this}" }) end,
mode = { "x", "n" },
desc = "Send This",
},
{
"<leader>af",
function() require("sidekick.cli").send({ msg = "{file}" }) end,
desc = "Send File",
},
{
"<leader>av",
function() require("sidekick.cli").send({ msg = "{selection}" }) end,
mode = { "x" },
desc = "Send Visual Selection",
},
{
"<leader>ap",
function() require("sidekick.cli").prompt() end,
mode = { "n", "x" },
desc = "Sidekick Select Prompt",
},
},
}
lualine.nvim (optional)
lualine
- Options
- Full Spec
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,
})
end
{
"nvim-lualine/lualine.nvim",
optional = true,
event = "VeryLazy",
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,
})
end,
}