Skip to content

Commit f79ce4a

Browse files
committed
feat: add folke/sidekick.nvim
1 parent b3680f2 commit f79ce4a

File tree

3 files changed

+113
-83
lines changed

3 files changed

+113
-83
lines changed

lua/astrocommunity/ai/sidekick-nivm/init.lua

Lines changed: 0 additions & 83 deletions
This file was deleted.
File renamed without changes.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---@type LazySpec
2+
return {
3+
"folke/sidekick.nvim",
4+
specs = {
5+
{
6+
"AstroNvim/astrocore",
7+
---@param opts AstroCoreOpts
8+
opts = function(_, opts)
9+
local maps = assert(opts.mappings)
10+
local prefix = "<Leader>A"
11+
12+
-- Normal mode mappings
13+
maps.n[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" }
14+
maps.n[prefix .. "a"] = {
15+
function() require("sidekick.cli").toggle() end,
16+
desc = "Sidekick Toggle CLI",
17+
}
18+
maps.n[prefix .. "s"] = {
19+
function() require("sidekick.cli").select() end,
20+
desc = "Select CLI",
21+
}
22+
maps.n[prefix .. "d"] = {
23+
function() require("sidekick.cli").close() end,
24+
desc = "Detach a CLI Session",
25+
}
26+
maps.n[prefix .. "t"] = {
27+
function() require("sidekick.cli").send { msg = "{this}" } end,
28+
desc = "Send This",
29+
}
30+
maps.n[prefix .. "f"] = {
31+
function() require("sidekick.cli").send { msg = "{file}" } end,
32+
desc = "Send File",
33+
}
34+
maps.n[prefix .. "p"] = {
35+
function() require("sidekick.cli").prompt() end,
36+
desc = "Select Prompt",
37+
}
38+
39+
maps.n[prefix .. "n"] = { desc = require("astroui").get_icon("SidekickBrain", 1, true) .. "NES" }
40+
maps.n[prefix .. "nt"] = {
41+
function() require("sidekick.nes").toggle() end,
42+
desc = "Toggle NES",
43+
}
44+
maps.n[prefix .. "ne"] = {
45+
function() require("sidekick.nes").enable() end,
46+
desc = "Enable NES",
47+
}
48+
maps.n[prefix .. "nd"] = {
49+
function() require("sidekick.nes").disable() end,
50+
desc = "Disable NES",
51+
}
52+
maps.n[prefix .. "nu"] = {
53+
function() require("sidekick.nes").update() end,
54+
desc = "Update Suggestions",
55+
}
56+
57+
maps.n["<Tab>"] = {
58+
function()
59+
if not require("sidekick").nes_jump_or_apply() then return "<Tab>" end
60+
end,
61+
expr = true,
62+
desc = "Goto/Apply Next Edit Suggestion",
63+
}
64+
maps.n["<C-.>"] = {
65+
function() require("sidekick.cli").toggle {} end,
66+
desc = "Sidekick Toggle",
67+
}
68+
69+
-- Visual mode mappings
70+
maps.x[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" }
71+
maps.x[prefix .. "t"] = {
72+
function() require("sidekick.cli").send { msg = "{this}" } end,
73+
desc = "Send This",
74+
}
75+
maps.x[prefix .. "v"] = {
76+
function() require("sidekick.cli").send { msg = "{selection}" } end,
77+
desc = "Send Visual Selection",
78+
}
79+
maps.x[prefix .. "p"] = {
80+
function() require("sidekick.cli").prompt {} end,
81+
desc = "Select Prompt",
82+
}
83+
maps.x["<C-.>"] = {
84+
function() require("sidekick.cli").toggle {} end,
85+
desc = "Sidekick Toggle",
86+
}
87+
88+
-- Insert mode mappings
89+
maps.i["<C-.>"] = {
90+
function() require("sidekick.cli").toggle {} end,
91+
desc = "Sidekick Toggle",
92+
}
93+
94+
-- Terminal mode mappings
95+
maps.t["<C-.>"] = {
96+
function() require("sidekick.cli").toggle {} end,
97+
desc = "Sidekick Toggle",
98+
}
99+
end,
100+
},
101+
{ "AstroNvim/astroui", opts = { icons = { Sidekick = "", SidekickBrain = "󰧑" } } },
102+
},
103+
opts = {
104+
nes = {
105+
enabled = true, -- If the user doesn't have the copilot LSP running internally this gets set as false
106+
},
107+
cli = {
108+
mux = {
109+
enabled = true,
110+
},
111+
},
112+
},
113+
}

0 commit comments

Comments
 (0)