feat(editor): add nvim-cmp completion keymaps #40

Merged
lyrathorpe merged 2 commits from feat/cmp-completion-keymaps into main 2026-06-23 16:33:13 +01:00
Showing only changes of commit 304b9a413a - Show all commits
+12
View File
@@ -89,6 +89,18 @@
enable = true; enable = true;
autoEnableSources = true; autoEnableSources = true;
settings = { settings = {
# nvim-cmp ships no default keymaps; without these the menu shows but
# nothing accepts it. confirm uses select=false so a bare <CR> stays a
# newline unless an entry is explicitly highlighted.
mapping = {
"<C-n>" = "cmp.mapping.select_next_item()";
"<C-p>" = "cmp.mapping.select_prev_item()";
"<Tab>" = "cmp.mapping.select_next_item()";
"<S-Tab>" = "cmp.mapping.select_prev_item()";
"<CR>" = "cmp.mapping.confirm({ select = false })";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.abort()";
};
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
sources = [ sources = [
{ name = "nvim_lsp"; } { name = "nvim_lsp"; }