Skip to content

Commit 909c119

Browse files
committed
Update keybindings for inline completion, sidekick plugin
1 parent d110a78 commit 909c119

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

dot_config/nvim/init.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ require('lazy').setup({
366366
if client and client:supports_method('textDocument/inlayHint', event.buf) then
367367
map('<leader>th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints')
368368
end
369+
370+
-- Enable `:help lsp-inline-completion` to receive suggestions from the Copilot Language Server
371+
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlineCompletion, event.buf) then
372+
vim.lsp.inline_completion.enable(true, { bufnr = event.buf })
373+
374+
map('<C-F>', vim.lsp.inline_completion.get, 'accept inline completion', 'i')
375+
map('<C-G>', vim.lsp.inline_completion.select, 'switch inline completion', 'i')
376+
end
369377
end,
370378
})
371379

dot_config/nvim/lua/custom/plugins/sidekick.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ return {
1616
},
1717
keys = {
1818
-- NES: jump to next edit, or apply if already on one
19-
{
20-
'<tab>',
21-
function()
22-
if require('sidekick').nes_jump_or_apply() then return end
23-
return '<tab>' -- fall back to normal tab
24-
end,
25-
mode = { 'i', 'n' },
26-
expr = true,
27-
desc = 'Goto/Apply Next Edit Suggestion',
28-
},
19+
-- {
20+
-- '<tab>',
21+
-- function()
22+
-- if require('sidekick').nes_jump_or_apply() then return end
23+
-- return '<tab>' -- fall back to normal tab
24+
-- end,
25+
-- mode = { 'i', 'n' },
26+
-- expr = true,
27+
-- desc = 'Goto/Apply Next Edit Suggestion',
28+
-- },
2929

3030
-- CLI window management
3131
{ '<c-.>', function() require('sidekick.cli').focus() end, mode = { 'n', 't', 'i', 'x' }, desc = 'Sidekick Focus' },
@@ -50,6 +50,6 @@ return {
5050
end,
5151
desc = 'Fi[x] Diagnostics in Function',
5252
},
53-
{ '<leader>ap', function() require('sidekick.cli').prompt() end, desc = 'Sidekick Select [P]rompt' },
53+
{ '<leader>ap', function() require('sidekick.cli').prompt() end, mode = { 'n', 'x' }, desc = 'Sidekick Select [P]rompt' },
5454
},
5555
}

0 commit comments

Comments
 (0)