mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
92 lines
2.3 KiB
Lua
92 lines
2.3 KiB
Lua
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)
|
|
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,
|
|
},
|
|
|
|
{
|
|
"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 },
|
|
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
|
|
{
|
|
"<leader>aa",
|
|
function()
|
|
require("sidekick.cli").toggle()
|
|
end,
|
|
mode = { "n" },
|
|
desc = "Sidekick Toggle",
|
|
},
|
|
{
|
|
"<leader>an",
|
|
function()
|
|
require("sidekick.cli").select_tool()
|
|
end,
|
|
mode = { "n" },
|
|
desc = "Sidekick New Tool",
|
|
},
|
|
{
|
|
"<c-.>",
|
|
function()
|
|
require("sidekick.cli").focus()
|
|
end,
|
|
mode = { "n", "x", "i", "t" },
|
|
desc = "Sidekick Switch Focus",
|
|
},
|
|
{
|
|
"<leader>ap",
|
|
function()
|
|
require("sidekick.cli").select_prompt()
|
|
end,
|
|
desc = "Sidekick Ask Prompt",
|
|
mode = { "n", "v" },
|
|
},
|
|
},
|
|
},
|
|
}
|