Skip to content

Commit 8755334

Browse files
committed
feat: add folke/sidekick.nvim
1 parent 35e50cf commit 8755334

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# folke/sidekick.nvim
2+
3+
Your Neovim AI sidekick
4+
5+
**Repository**: <https://github.com/folke/sidekick.nvim>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
local cli_tool = vim.g.sidekick_cli_tool or "opencode"
2+
local prefix = "<Leader>A"
3+
4+
---@type LazySpec
5+
return {
6+
"folke/sidekick.nvim",
7+
specs = {
8+
{
9+
"AstroNvim/astrocore",
10+
---@param opts AstroCoreOpts
11+
opts = function(_, opts)
12+
local maps = assert(opts.mappings)
13+
maps.n[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" }
14+
maps.x[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" }
15+
end,
16+
},
17+
{ "AstroNvim/astroui", opts = { icons = { Sidekick = "" } } },
18+
},
19+
opts = {
20+
nes = {
21+
enabled = true, -- If the user doesn't have the copilot LSP running internally this gets set as false
22+
},
23+
cli = {
24+
mux = {
25+
enabled = true,
26+
},
27+
},
28+
},
29+
keys = {
30+
{
31+
"<tab>",
32+
function()
33+
if not require("sidekick").nes_jump_or_apply() then return "<Tab>" end
34+
end,
35+
expr = true,
36+
desc = "Goto/Apply Next Edit Suggestion",
37+
},
38+
{
39+
"<c-.>",
40+
function() require("sidekick.cli").toggle { name = cli_tool } end,
41+
desc = "Sidekick Toggle",
42+
mode = { "n", "t", "i", "x" },
43+
},
44+
{
45+
prefix .. "a",
46+
function() require("sidekick.cli").toggle { name = cli_tool } end,
47+
desc = "Sidekick Toggle CLI",
48+
},
49+
{
50+
prefix .. "s",
51+
function() require("sidekick.cli").select { name = cli_tool } end,
52+
desc = "Select CLI",
53+
},
54+
{
55+
prefix .. "d",
56+
function() require("sidekick.cli").close { name = cli_tool } end,
57+
desc = "Detach a CLI Session",
58+
},
59+
{
60+
prefix .. "t",
61+
function() require("sidekick.cli").send { name = cli_tool, msg = "{this}" } end,
62+
mode = { "x", "n" },
63+
desc = "Send This",
64+
},
65+
{
66+
prefix .. "f",
67+
function() require("sidekick.cli").send { name = cli_tool, msg = "{file}" } end,
68+
desc = "Send File",
69+
},
70+
{
71+
prefix .. "v",
72+
function() require("sidekick.cli").send { name = cli_tool, msg = "{selection}" } end,
73+
mode = { "x" },
74+
desc = "Send Visual Selection",
75+
},
76+
{
77+
prefix .. "p",
78+
function() require("sidekick.cli").prompt { name = cli_tool } end,
79+
mode = { "n", "x" },
80+
desc = "Sidekick Select Prompt",
81+
},
82+
},
83+
}

0 commit comments

Comments
 (0)