Compare commits

...

2 Commits

Author SHA1 Message Date
Emma Thorpe c5e0cadcd2 docs(editor): document nvim-cmp completion menu keybindings
CI / flake (pull_request) Failing after 2m46s
Add a completion-menu table to KEYBINDINGS.md covering the new cmp
mappings (Tab/S-Tab and C-n/C-p to move, C-Space to open, Enter to
confirm, C-e to dismiss), and reword the Neovim summary accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 16:20:03 +01:00
Emma Thorpe 304b9a413a feat(editor): add nvim-cmp completion keymaps
CI / flake (pull_request) Successful in 4m13s
nvim-cmp ships no default mappings, so the completion menu (including the
path source) appeared but nothing could navigate or accept it. Bind the
usual set: C-n/C-p and Tab/S-Tab to move, C-Space to open, C-e to abort,
and <CR> to confirm with select=false so a bare Enter stays a newline
unless an entry is explicitly highlighted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 16:17:05 +01:00
2 changed files with 28 additions and 4 deletions
+16 -4
View File
@@ -188,10 +188,22 @@ across vim splits and tmux panes seamlessly. Everything else is stock vim, plus:
| `<leader>rn` | Rename symbol (LSP; `<leader>` is `Space`) |
| `<leader>ca` | Code action (LSP) |
LSP covers Nix, Lua, Python and Terraform (the work box adds C# and Helm);
completion (nvim-cmp) appears as you type. Files are formatted on save
(conform-nvim). `:Git` opens fugitive; gitsigns shows gutter signs. which-key
pops up after `<leader>` to show the rest.
### Completion menu (nvim-cmp)
Active only while the completion popup is open (it appears as you type, e.g.
file paths):
| Shortcut | Action |
| ----------------------- | ------------------------------------------------------------------ |
| `Tab` / `Shift`+`Tab` | Select next / previous item |
| `Ctrl`+`n` / `Ctrl`+`p` | Select next / previous item |
| `Ctrl`+`Space` | Open the completion menu |
| `Enter` | Confirm the highlighted item (no auto-select; otherwise a newline) |
| `Ctrl`+`e` | Dismiss the menu |
LSP covers Nix, Lua, Python and Terraform (the work box adds C# and Helm).
Files are formatted on save (conform-nvim). `:Git` opens fugitive; gitsigns
shows gutter signs. which-key pops up after `<leader>` to show the rest.
---
+12
View File
@@ -89,6 +89,18 @@
enable = true;
autoEnableSources = true;
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";
sources = [
{ name = "nvim_lsp"; }