feat(keymap): add F11 and F12 key bindings for completion and Copilot

This commit introduces new key mappings for enhanced functionality, specifically the F11 key now confirms suggestions in the completion menu while F12 is set to accept Copilot suggestions in insert mode, improving the user experience for code suggestions.
pull/1638/head
OdysseusOperator 4 months ago
parent 21117f7f1e
commit 4b2d4334ca

@ -867,7 +867,7 @@ require('lazy').setup({
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true },
['<F11>'] = cmp.mapping.confirm { select = true },
-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
--['<CR>'] = cmp.mapping.confirm { select = true },

@ -153,6 +153,12 @@ return {
vim.keymap.set('n', '<leader>cp', function()
vim.cmd [[Copilot toggle]]
end, { noremap = true, silent = true, desc = 'Toggle Copilot' })
vim.keymap.set('i', '<F12>', 'copilot#Accept("\\<CR>")', {
expr = true,
replace_keycodes = false,
})
vim.g.copilot_no_tab_map = true
end,
},
{

Loading…
Cancel
Save