Skip to content

Commit 90e6c3b

Browse files
committed
chore: try folke/sidekick as AI assistant integration
1 parent 0e901e5 commit 90e6c3b

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

lua/custom/plugins/sidekick.lua

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
-- sidekick.nvim is your Neovim AI sidekick that integrates Copilot LSP's "Next Edit Suggestions" with a built-in terminal for any AI CLI.
2+
-- https://workeraworkspace.slack.com/archives/C06A563F3P0/p1759230121175309
3+
4+
return {
5+
'folke/sidekick.nvim',
6+
opts = {
7+
-- add any options here
8+
cli = {
9+
mux = {
10+
backend = 'tmux',
11+
enabled = true,
12+
},
13+
},
14+
},
15+
debug = true,
16+
keys = {
17+
{
18+
'<tab>',
19+
function()
20+
-- if there is a next edit, jump to it, otherwise apply it if any
21+
if not require('sidekick').nes_jump_or_apply() then
22+
return '<Tab>' -- fallback to normal tab
23+
end
24+
end,
25+
expr = true,
26+
desc = 'Goto/Apply Next Edit Suggestion',
27+
},
28+
{
29+
'<leader>aa',
30+
function()
31+
require('sidekick.cli').toggle()
32+
end,
33+
mode = { 'n', 'v' },
34+
desc = 'Sidekick Toggle CLI',
35+
},
36+
{
37+
'<leader>as',
38+
function()
39+
require('sidekick.cli').select()
40+
end,
41+
-- Or to select only installed tools:
42+
-- require("sidekick.cli").select({ filter = { installed = true } })
43+
desc = 'Sidekick Select CLI',
44+
},
45+
{
46+
'<leader>as',
47+
function()
48+
require('sidekick.cli').send { selection = true }
49+
end,
50+
mode = { 'v' },
51+
desc = 'Sidekick Send Visual Selection',
52+
},
53+
{
54+
'<leader>ap',
55+
function()
56+
require('sidekick.cli').prompt()
57+
end,
58+
mode = { 'n', 'v' },
59+
desc = 'Sidekick Select Prompt',
60+
},
61+
{
62+
'<c-.>',
63+
function()
64+
require('sidekick.cli').focus()
65+
end,
66+
mode = { 'n', 'x', 'i', 't' },
67+
desc = 'Sidekick Switch Focus',
68+
},
69+
-- Example of a keybinding to open Claude directly
70+
{
71+
'<leader>ac',
72+
function()
73+
require('sidekick.cli').toggle { name = 'claude', focus = true }
74+
end,
75+
desc = 'Sidekick Claude Toggle',
76+
mode = { 'n', 'v' },
77+
},
78+
},
79+
}

0 commit comments

Comments
 (0)