Files
rootiest 6e1c6d081a docs: add generated Vim keymap cheatsheet
Interactive single-file cheatsheet of every built-in key and this
config's live keymaps, generated by docs/cheatsheet/gen_cheatsheet.py
from $VIMRUNTIME/doc/index.txt, a headless dump of the config
(dump.lua) and curated plugin/config notes (curated/*.json).
2026-10-03 23:39:28 -04:00

157 lines
33 KiB
JSON

{
"groups": {
"<leader>b": {"name": "Buffer", "cat": "Buffer & tab"},
"<leader>c": {"name": "Code", "cat": "LSP & diagnostics"},
"<leader>cb": {"name": "Comment box", "cat": "Comment"},
"<leader>f": {"name": "Find", "cat": "Find & pick"},
"<leader>g": {"name": "Git", "cat": "Git"},
"<leader>h": {"name": "Haunt bookmarks", "cat": "Mark & jump"},
"<leader>q": {"name": "Session", "cat": "Session"},
"<leader>s": {"name": "Search", "cat": "Find & pick"},
"<leader>u": {"name": "UI / toggles", "cat": "UI & toggles"}
},
"map_desc": [
{"s": "config", "m": "*", "k": "<leader><Space>", "cat": "Find & pick", "sl": "smart find", "e": 1, "n": "Snacks smart picker: open buffers, recent files and project files ranked together (frecency)"},
{"s": "config", "m": "*", "k": "<leader>,", "cat": "Buffer & tab", "sl": "buffers", "e": 1},
{"s": "config", "m": "*", "k": "<leader>/", "cat": "Find & pick", "sl": "grep", "e": 1, "n": "Live grep (ripgrep) from the current working directory, which auto-cd keeps at the project root"},
{"s": "config", "m": "*", "k": "<leader>:", "cat": "Command line", "sl": "cmd hist"},
{"s": "config", "m": "*", "k": "<leader>n", "cat": "UI & toggles", "sl": "notifs", "n": "Snacks notifier history window (<code>lua/keymaps.lua:291</code>)"},
{"s": "config", "m": "*", "k": "<leader>e", "cat": "Files", "sl": "explorer", "e": 1, "n": "Snacks file explorer (sidebar)"},
{"s": "config", "m": "*", "k": "<leader>N", "cat": "Help", "sl": "news", "n": "Shows Neovim's <code>news.txt</code> in a floating window"},
{"s": "config", "m": "*", "k": "<leader>.", "cat": "Misc", "sl": "scratch", "n": "Toggle a persistent scratch buffer (Snacks)"},
{"s": "config", "m": "*", "k": "<leader>S", "cat": "Misc", "sl": "scratches", "n": "Pick one of the saved scratch buffers"},
{"s": "config", "m": "*", "k": "<leader>z", "cat": "UI & toggles", "sl": "zen", "n": "Snacks zen mode: distraction-free centered window"},
{"s": "config", "m": "*", "k": "<leader>Z", "cat": "Window", "sl": "zoom", "n": "Snacks zoom: maximize the current window, again to restore"},
{"s": "config", "m": "*", "k": "<leader>fb", "cat": "Buffer & tab", "sl": "buffers"},
{"s": "config", "m": "*", "k": "<leader>fc", "cat": "Files", "sl": "config", "n": "Files under <code>stdpath('config')</code> (~/.config/nvim)"},
{"s": "config", "m": "*", "k": "<leader>ff", "cat": "Find & pick", "sl": "files", "e": 1},
{"s": "config", "m": "*", "k": "<leader>fg", "cat": "Find & pick", "sl": "git files", "n": "Only files tracked by git"},
{"s": "config", "m": "*", "k": "<leader>fp", "cat": "Find & pick", "sl": "projects"},
{"s": "config", "m": "*", "k": "<leader>fr", "cat": "Find & pick", "sl": "recent", "e": 1},
{"s": "config", "m": "*", "k": "<leader>gb", "cat": "Git", "sl": "branches"},
{"s": "config", "m": "*", "k": "<leader>gl", "cat": "Git", "sl": "log"},
{"s": "config", "m": "*", "k": "<leader>gL", "cat": "Git", "sl": "line log", "n": "Git log of the current line"},
{"s": "config", "m": "*", "k": "<leader>gs", "cat": "Git", "sl": "status", "e": 1},
{"s": "config", "m": "*", "k": "<leader>gS", "cat": "Git", "sl": "stash"},
{"s": "config", "m": "*", "k": "<leader>gd", "cat": "Git", "sl": "hunks", "n": "Picker of changed hunks (<code>git diff</code>)"},
{"s": "config", "m": "*", "k": "<leader>gf", "cat": "Git", "sl": "file log", "n": "Git log of the current file"},
{"s": "config", "m": "*", "k": "<leader>gB", "cat": "Git", "sl": "browse", "n": "Open the file on the remote's web UI; from Visual mode the selected lines are linked"},
{"s": "config", "m": "*", "k": "<leader>gg", "cat": "Git", "sl": "lazygit", "e": 1, "n": "Lazygit in a Snacks floating terminal"},
{"s": "config", "m": "*", "k": "<leader>gi", "cat": "Git", "sl": "issues", "n": "Snacks GitHub picker; needs the <code>gh</code> CLI, logged in"},
{"s": "config", "m": "*", "k": "<leader>gI", "cat": "Git", "sl": "all issues", "n": "Snacks GitHub picker; needs the <code>gh</code> CLI, logged in"},
{"s": "config", "m": "*", "k": "<leader>gp", "cat": "Git", "sl": "PRs", "n": "Snacks GitHub picker; needs the <code>gh</code> CLI, logged in"},
{"s": "config", "m": "*", "k": "<leader>gP", "cat": "Git", "sl": "all PRs", "n": "Snacks GitHub picker; needs the <code>gh</code> CLI, logged in"},
{"s": "config", "m": "*", "k": "<leader>gt", "cat": "Git", "sl": "tea PRs", "n": "snacks-tea (Gitea/Forgejo); needs the <code>tea</code> CLI logged in, uses the <code>origin</code> remote"},
{"s": "config", "m": "*", "k": "<leader>gT", "cat": "Git", "sl": "tea all PRs", "n": "snacks-tea (Gitea/Forgejo); needs the <code>tea</code> CLI logged in, uses the <code>origin</code> remote"},
{"s": "config", "m": "*", "k": "<leader>gc", "cat": "Git", "sl": "tea new PR", "n": "snacks-tea (Gitea/Forgejo); needs the <code>tea</code> CLI logged in, uses the <code>origin</code> remote"},
{"s": "config", "m": "*", "k": "<leader>sb", "cat": "Search", "sl": "lines", "n": "Fuzzy search the lines of the current buffer"},
{"s": "config", "m": "*", "k": "<leader>sB", "cat": "Search", "sl": "grep bufs"},
{"s": "config", "m": "*", "k": "<leader>sg", "cat": "Find & pick", "sl": "grep", "n": "Same as <kbd>&lt;leader&gt;/</kbd>"},
{"s": "config", "m": "*", "k": "<leader>sw", "cat": "Search", "sl": "grep word", "n": "Normal: word under the cursor. Visual: the selection"},
{"s": "config", "m": "*", "k": "<leader>s\"", "cat": "Register & macro", "sl": "registers"},
{"s": "config", "m": "*", "k": "<leader>s/", "cat": "Search", "sl": "search hist"},
{"s": "config", "m": "*", "k": "<leader>sa", "cat": "Misc", "sl": "autocmds"},
{"s": "config", "m": "*", "k": "<leader>sc", "cat": "Command line", "sl": "cmd hist"},
{"s": "config", "m": "*", "k": "<leader>sC", "cat": "Command line", "sl": "commands"},
{"s": "config", "m": "*", "k": "<leader>sd", "cat": "LSP & diagnostics", "sl": "diagnostics", "e": 1},
{"s": "config", "m": "*", "k": "<leader>sD", "cat": "LSP & diagnostics", "sl": "buf diags"},
{"s": "config", "m": "*", "k": "<leader>sh", "cat": "Help", "sl": "help", "e": 1},
{"s": "config", "m": "*", "k": "<leader>sH", "cat": "UI & toggles", "sl": "highlights"},
{"s": "config", "m": "*", "k": "<leader>si", "cat": "Misc", "sl": "icons"},
{"s": "config", "m": "*", "k": "<leader>sj", "cat": "Mark & jump", "sl": "jumps", "n": "Jumplist picker: a way to go forward in the jumplist now that <kbd>&lt;Tab&gt;</kbd>/<kbd>&lt;C-I&gt;</kbd> is Sidekick NES"},
{"s": "config", "m": "*", "k": "<leader>sk", "cat": "Help", "sl": "keymaps", "e": 1},
{"s": "config", "m": "*", "k": "<leader>sl", "cat": "Quickfix & lists", "sl": "loclist"},
{"s": "config", "m": "*", "k": "<leader>sm", "cat": "Mark & jump", "sl": "marks"},
{"s": "config", "m": "*", "k": "<leader>sM", "cat": "Help", "sl": "man pages"},
{"s": "config", "m": "*", "k": "<leader>sp", "cat": "Find & pick", "sl": "plugin spec", "n": "Greps <code>lua/plugins.lua</code> for every <code>vim.pack</code> spec (<code>src = \"https://…</code>); type to filter by plugin name"},
{"s": "config", "m": "*", "k": "<leader>sq", "cat": "Quickfix & lists", "sl": "quickfix", "n": "Snacks picker over the quickfix list"},
{"s": "config", "m": "*", "k": "<leader>sR", "cat": "Find & pick", "sl": "resume", "n": "Reopen the last picker with its query"},
{"s": "config", "m": "*", "k": "<leader>su", "cat": "Undo & repeat", "sl": "undo hist", "n": "Snacks undo-tree picker with diff preview"},
{"s": "config", "m": "*", "k": "<leader>ss", "cat": "LSP & diagnostics", "sl": "symbols"},
{"s": "config", "m": "*", "k": "<leader>sS", "cat": "LSP & diagnostics", "sl": "ws symbols"},
{"s": "config", "m": "*", "k": "<leader>sr", "cat": "Search", "sl": "replace", "e": 1, "n": "Grug-far project-wide search &amp; replace, prefilled with the word under the cursor; <kbd>q</kbd> closes it"},
{"s": "config", "m": "*", "k": "<leader>uC", "cat": "UI & toggles", "sl": "colors"},
{"s": "config", "m": "*", "k": "<leader>un", "cat": "UI & toggles", "sl": "dismiss"},
{"s": "config", "m": "*", "k": "<leader>uu", "cat": "Undo & repeat", "sl": "undotree", "e": 1, "n": "Toggle the undotree side panel (persistent undo is on)"},
{"s": "config", "m": "*", "k": "<leader>ca", "cat": "LSP & diagnostics", "sl": "code action", "e": 1, "n": "Neovim's <kbd>gra</kbd> does the same"},
{"s": "config", "m": "*", "k": "<leader>cr", "cat": "LSP & diagnostics", "sl": "rename", "e": 1, "n": "Puts <code>:IncRename &lt;cword&gt;</code> on the command line with a live preview: edit the name, then <kbd>&lt;CR&gt;</kbd>. Neovim's <kbd>grn</kbd> renames without the preview"},
{"s": "config", "m": "*", "k": "<leader>cR", "cat": "Files", "sl": "rename file", "n": "Rename the current file on disk; tells LSP servers (willRenameFiles) so imports can follow"},
{"s": "config", "m": "*", "k": "<leader>cf", "cat": "Edit", "sl": "format", "e": 1, "n": "conform.nvim with LSP fallback; in Visual mode only the selection is formatted"},
{"s": "config", "m": "*", "k": "<leader>cbb", "cat": "Comment", "sl": "box", "n": "Wrap the line(s) in a centered comment box (comment-box.nvim)"},
{"s": "config", "m": "*", "k": "<leader>cbl", "cat": "Comment", "sl": "line", "n": "Insert a centered comment line"},
{"s": "config", "m": "*", "k": "<leader>cbd", "cat": "Comment", "sl": "del box", "n": "Remove a comment box or titled line around the text"},
{"s": "config", "m": "*", "k": "<leader>cbk", "cat": "Comment", "sl": "catalog", "n": "Show all box and line styles"},
{"s": "config", "m": "*", "k": "<leader>bd", "cat": "Buffer & tab", "sl": "del buffer", "e": 1, "n": "Snacks.bufdelete(): delete the buffer but keep the window layout"},
{"s": "config", "m": "*", "k": "<leader>qs", "cat": "Session", "sl": "restore", "n": "persistence.nvim: one session per directory and git branch, saved automatically on exit"},
{"s": "config", "m": "*", "k": "<leader>qS", "cat": "Session", "sl": "select", "n": "persistence.nvim: one session per directory and git branch, saved automatically on exit"},
{"s": "config", "m": "*", "k": "<leader>ql", "cat": "Session", "sl": "last"},
{"s": "config", "m": "*", "k": "<leader>qd", "cat": "Session", "sl": "no save", "n": "Stop persistence from saving the session when you quit"},
{"s": "config", "m": "*", "k": "<leader>ha", "cat": "Mark & jump", "sl": "annotate", "n": "Bookmark the current line with an annotation shown as virtual text (prompts for the text)"},
{"s": "config", "m": "*", "k": "<leader>ht", "cat": "Mark & jump", "sl": "show note", "n": "Show/hide the annotation of the bookmark on this line"},
{"s": "config", "m": "*", "k": "<leader>hd", "cat": "Mark & jump", "sl": "del mark"},
{"s": "config", "m": "*", "k": "<leader>hn", "cat": "Mark & jump", "sl": "next mark"},
{"s": "config", "m": "*", "k": "<leader>hp", "cat": "Mark & jump", "sl": "prev mark"},
{"s": "config", "m": "*", "k": "<leader>hl", "cat": "Mark & jump", "sl": "bookmarks", "n": "Snacks picker of all Haunt bookmarks"},
{"s": "config", "m": "*", "k": "<Tab>", "cat": "Completion & AI", "sl": "NES", "e": 1, "n": "Jumps to, then applies, the Sidekick next-edit suggestion. With no suggestion it is a plain jump forward (count works). <kbd>&lt;C-i&gt;</kbd> is mapped separately, so terminals that can tell them apart (kitty, Neovide) keep it as jump forward"},
{"s": "config", "m": "*", "k": "d", "cat": "Operator", "d": "Delete {motion} into register d (clipboard untouched)", "force": false, "sl": "del→\"d", "e": 1, "n": "Remapped to <code>\"d{key}</code> (<code>lua/keymaps.lua:23-28</code>) so the system clipboard keeps your last yank. Paste deleted text with <kbd>\"dp</kbd>. A register you type first wins (<kbd>\"add</kbd>, <kbd>\"_dd</kbd>), except <kbd>\"+</kbd>, which looks like the default. Normal and Visual mode only"},
{"s": "config", "m": "*", "k": "D", "cat": "Edit", "d": "Delete to end of line into register d", "force": false, "sl": "D→\"d", "n": "Remapped to <code>\"d{key}</code> (<code>lua/keymaps.lua:23-28</code>) so the system clipboard keeps your last yank. Paste deleted text with <kbd>\"dp</kbd>. A register you type first wins (<kbd>\"add</kbd>, <kbd>\"_dd</kbd>), except <kbd>\"+</kbd>, which looks like the default. Normal and Visual mode only"},
{"s": "config", "m": "*", "k": "c", "cat": "Operator", "d": "Change {motion}; the old text goes to register d", "force": false, "sl": "chg→\"d", "e": 1, "n": "Remapped to <code>\"d{key}</code> (<code>lua/keymaps.lua:23-28</code>) so the system clipboard keeps your last yank. Paste deleted text with <kbd>\"dp</kbd>. A register you type first wins (<kbd>\"add</kbd>, <kbd>\"_dd</kbd>), except <kbd>\"+</kbd>, which looks like the default. Normal and Visual mode only"},
{"s": "config", "m": "*", "k": "C", "cat": "Edit", "d": "Change to end of line; the old text goes to register d", "force": false, "sl": "C→\"d", "n": "Remapped to <code>\"d{key}</code> (<code>lua/keymaps.lua:23-28</code>) so the system clipboard keeps your last yank. Paste deleted text with <kbd>\"dp</kbd>. A register you type first wins (<kbd>\"add</kbd>, <kbd>\"_dd</kbd>), except <kbd>\"+</kbd>, which looks like the default. Normal and Visual mode only"},
{"s": "config", "m": "*", "k": "x", "cat": "Edit", "d": "Delete character(s) under the cursor into register d", "force": false, "sl": "x→\"d", "e": 1, "n": "Remapped to <code>\"d{key}</code> (<code>lua/keymaps.lua:23-28</code>) so the system clipboard keeps your last yank. Paste deleted text with <kbd>\"dp</kbd>. A register you type first wins (<kbd>\"add</kbd>, <kbd>\"_dd</kbd>), except <kbd>\"+</kbd>, which looks like the default. Normal and Visual mode only"},
{"s": "config", "m": "*", "k": "X", "cat": "Edit", "d": "Delete character(s) before the cursor into register d", "force": false, "sl": "X→\"d", "n": "Remapped to <code>\"d{key}</code> (<code>lua/keymaps.lua:23-28</code>) so the system clipboard keeps your last yank. Paste deleted text with <kbd>\"dp</kbd>. A register you type first wins (<kbd>\"add</kbd>, <kbd>\"_dd</kbd>), except <kbd>\"+</kbd>, which looks like the default. Normal and Visual mode only"},
{"s": "config", "m": "*", "k": "K", "cat": "LSP & diagnostics", "sl": "hover", "e": 1, "n": "Always LSP hover, in every buffer: no fallback to <code>'keywordprg'</code> (<code>:Man</code>, <code>:help</code>) when no LSP is attached"},
{"s": "config", "m": "*", "k": "gd", "cat": "LSP & diagnostics", "sl": "definition", "e": 1, "n": "Snacks LSP picker (jumps directly when there is a single result). Needs an attached LSP server; replaces Vim's search-based <kbd>gd</kbd>"},
{"s": "config", "m": "*", "k": "gD", "cat": "LSP & diagnostics", "sl": "declaration", "n": "Snacks LSP picker (jumps directly when there is a single result). Needs an attached LSP server; replaces Vim's search-based <kbd>gD</kbd>"},
{"s": "config", "m": "*", "k": "gI", "cat": "LSP & diagnostics", "sl": "impl", "n": "Snacks LSP picker (jumps directly when there is a single result). Needs an attached LSP server; replaces Vim's <kbd>gI</kbd> (insert at column 1, use <kbd>0i</kbd>)"},
{"s": "config", "m": "*", "k": "gy", "cat": "LSP & diagnostics", "sl": "type def", "n": "Snacks LSP picker (jumps directly when there is a single result). Needs an attached LSP server"},
{"s": "config", "m": "*", "k": "gai", "cat": "LSP & diagnostics", "sl": "calls in", "n": "Incoming calls picker. Makes Vim's <kbd>ga</kbd> wait <code>'timeoutlen'</code>"},
{"s": "config", "m": "*", "k": "gao", "cat": "LSP & diagnostics", "sl": "calls out", "n": "Outgoing calls picker. Makes Vim's <kbd>ga</kbd> wait <code>'timeoutlen'</code>"},
{"s": "config", "m": "*", "k": "j", "cat": "Motion", "sl": "down", "e": 1, "n": "Without a count moves by display (wrapped) line like <kbd>gj</kbd>/<kbd>gk</kbd>; with a count (<kbd>5j</kbd>, even <kbd>1j</kbd>) moves by real lines. Not mapped in Operator-pending mode, so <kbd>dj</kbd> stays linewise"},
{"s": "config", "m": "*", "k": "k", "cat": "Motion", "sl": "up", "e": 1, "n": "Without a count moves by display (wrapped) line like <kbd>gj</kbd>/<kbd>gk</kbd>; with a count (<kbd>5j</kbd>, even <kbd>1j</kbd>) moves by real lines. Not mapped in Operator-pending mode, so <kbd>dj</kbd> stays linewise"},
{"s": "config", "m": "*", "k": "<Down>", "cat": "Motion", "sl": "down", "n": "Without a count moves by display (wrapped) line like <kbd>gj</kbd>/<kbd>gk</kbd>; with a count (<kbd>5j</kbd>, even <kbd>1j</kbd>) moves by real lines. Not mapped in Operator-pending mode, so <kbd>dj</kbd> stays linewise"},
{"s": "config", "m": "*", "k": "<Up>", "cat": "Motion", "sl": "up", "n": "Without a count moves by display (wrapped) line like <kbd>gj</kbd>/<kbd>gk</kbd>; with a count (<kbd>5j</kbd>, even <kbd>1j</kbd>) moves by real lines. Not mapped in Operator-pending mode, so <kbd>dj</kbd> stays linewise"},
{"s": "config", "m": "i", "k": "<Down>", "cat": "Insert", "sl": "down", "n": "Moves by display line in Insert mode (<code>normal! gj</code>/<code>gk</code>); the native popup menu and blink.cmp's menu keep their own arrow keys"},
{"s": "config", "m": "i", "k": "<Up>", "cat": "Insert", "sl": "up", "n": "Moves by display line in Insert mode (<code>normal! gj</code>/<code>gk</code>); the native popup menu and blink.cmp's menu keep their own arrow keys"},
{"s": "config", "m": "*", "k": "<C-/>", "cat": "Terminal", "sl": "terminal", "e": 1, "n": "Toggle a Snacks floating terminal (Normal and Terminal mode). <kbd>&lt;C-_&gt;</kbd> is the same for terminals that send Ctrl+/ as Ctrl+_"},
{"s": "config", "m": "*", "k": "grr", "cat": "LSP & diagnostics", "sl": "references", "e": 1, "n": "Snacks picker for LSP references; replaces Neovim's <kbd>grr</kbd> list. The other <kbd>gr</kbd>* defaults (<kbd>grn</kbd> <kbd>gra</kbd> <kbd>gri</kbd> <kbd>grt</kbd> <kbd>grx</kbd>) work as normal"},
{"s": "config", "m": "*", "k": "<leader>ur", "cat": "Search", "sl": "nohl", "n": "Clears search highlighting; Neovim's <kbd>&lt;C-L&gt;</kbd> does it too"},
{"s": "config", "m": "*", "k": "<C-I>", "cat": "Mark & jump", "sl": "jump fwd", "n": "Mapped to itself so it stays jump forward where the terminal can tell it from <kbd>&lt;Tab&gt;</kbd> (<code>:h CTRL-I</code>)"},
{"s": "config", "m": "*", "k": "gx", "cat": "Files", "sl": "open", "e": 1, "n": "gx.nvim's <code>:Browse</code>: URLs, files, plugin names → GitHub, <code>#123</code> issues, package.json deps, otherwise a web search. Works on a Visual selection too"}
],
"entries": [
{"k": "<C-S-v>", "m": ["n"], "s": "config", "cat": "Register & macro", "ctx": "Neovide only", "sl": "paste", "d": "Paste the system clipboard (an empty line is replaced by the paste)", "n": "On an empty line the clipboard lines replace it and the cursor goes to the end of the paste; otherwise runs <code>\"+]p</code> (put after, indent adjusted). <code>lua/options.lua:203</code>"},
{"k": "<C-S-v>", "m": ["i", "c"], "s": "config", "cat": "Register & macro", "ctx": "Neovide only", "sl": "paste", "d": "Paste the system clipboard (<C-R>+)", "n": "<code>lua/options.lua:222-223</code>"},
{"k": "<C-S-v>", "m": ["x", "s"], "s": "config", "cat": "Register & macro", "ctx": "Neovide only", "sl": "paste", "d": "Replace the selection with the system clipboard", "n": "<code>\"+p</code>, <code>lua/options.lua:224</code>"},
{"k": "<C-S-v>", "m": ["t"], "s": "config", "cat": "Terminal", "ctx": "Neovide only", "sl": "paste", "d": "Paste the system clipboard into the terminal", "n": "<code>&lt;C-\\&gt;&lt;C-n&gt;\"+pi</code>, <code>lua/options.lua:225</code>"},
{"k": "<C-S-c>", "m": ["x", "s"], "s": "config", "cat": "Register & macro", "ctx": "Neovide only", "sl": "copy", "d": "Copy the selection to the system clipboard", "n": "<code>lua/options.lua:231</code>"},
{"k": "<C-S-c>", "m": ["n"], "s": "config", "cat": "Register & macro", "ctx": "Neovide only", "sl": "copy line", "d": "Copy the current line to the system clipboard", "n": "<code>lua/options.lua:233</code>"},
{"k": "<C-S-x>", "m": ["x", "s"], "s": "config", "cat": "Register & macro", "ctx": "Neovide only", "sl": "cut", "d": "Cut the selection to the system clipboard", "n": "Uses <code>\"+d</code> without remapping, so unlike <kbd>d</kbd> it really fills the clipboard. <code>lua/options.lua:239</code>"},
{"k": "<C-S-x>", "m": ["n"], "s": "config", "cat": "Register & macro", "ctx": "Neovide only", "sl": "cut line", "d": "Cut the current line to the system clipboard", "n": "<code>lua/options.lua:241</code>"},
{"k": "<C-_>", "m": ["n", "t"], "s": "config", "cat": "Terminal", "sl": "terminal", "d": "Toggle the Snacks terminal (alias of <C-/>)", "n": "For terminals that encode Ctrl+/ as Ctrl+_ (no CSI u). Hidden from which-key (<code>which_key_ignore</code>), <code>lua/keymaps.lua:312</code>"},
{"k": "q", "m": ["n"], "s": "config", "cat": "Search", "ctx": "Grug-far buffer", "sl": "close", "d": "Close the Grug-far window", "n": "Buffer-local, replaces macro recording there. <code>lua/options.lua:127-133</code>"}
],
"commands": {
"Q": "Write all changed buffers (even read-only ones) and quit, no prompts (:xa!)",
"Format": "Format the buffer, or [range], with conform.nvim (async, LSP fallback)"
},
"notes": [
{"title": "Leader is Space, local leader is backslash", "kind": "change", "lead": "Set before any plugin loads, so every plugin sees them.", "rows": [["<kbd>&lt;Space&gt;</kbd>", "<code>&lt;leader&gt;</code>: 80+ Normal-mode maps and a few Visual ones, grouped as listed in the which-key popup"], ["<kbd>\\</kbd>", "<code>&lt;localleader&gt;</code> (plugin buffer keys such as Grug-far's)"], ["<kbd>&lt;Space&gt;</kbd> alone", "No longer moves right like <kbd>l</kbd>: Neovim waits for the next key (which-key shows the options)"]], "note": "<code>lua/options.lua:15-16</code>", "keys": ["<Space>"]},
{"title": "Yank and put use the system clipboard", "kind": "change", "lead": "<code>clipboard=unnamedplus</code>: every yank, delete and put that would use the unnamed register uses <code>\"+</code> instead.", "rows": [["<kbd>y</kbd> <kbd>yy</kbd> <kbd>Y</kbd>", "Copy to the system clipboard (<code>\"+</code>) and <code>\"0</code>"], ["<kbd>p</kbd> <kbd>P</kbd>", "Paste the system clipboard: your last yank, or whatever another app copied"], ["<kbd>\"0p</kbd>", "Last yank made inside Neovim, even after copying elsewhere"]], "note": "<code>lua/keymaps.lua:13</code>. Deletes are redirected, see the next card.", "keys": ["y", "p", "P"]},
{"title": "Deleting never touches the clipboard: d c x go to register d", "kind": "change", "lead": "Applies in Normal and Visual mode. A register you type first still wins.", "rows": [["<kbd>d</kbd> <kbd>D</kbd> <kbd>c</kbd> <kbd>C</kbd> <kbd>x</kbd> <kbd>X</kbd>", "Run as <code>\"dd</code>, <code>\"dD</code>, … so the deleted text lands in <code>\"d</code> (and <code>\"1</code> for whole lines)"], ["<kbd>\"a</kbd><kbd>d</kbd>… <kbd>\"_</kbd><kbd>d</kbd>…", "An explicit register is honoured (black hole works); only <kbd>\"+</kbd> is treated as the default, so use <kbd>yy</kbd> then <kbd>dd</kbd> to cut to the clipboard"], ["<kbd>\"dp</kbd>", "Paste what you just deleted (plain <kbd>p</kbd> pastes the clipboard)"], ["<kbd>xp</kbd> <kbd>ddp</kbd>", "Classic swap idioms paste the clipboard instead; use <kbd>x\"dp</kbd> / <kbd>dd\"dp</kbd>"], ["<kbd>cc</kbd> <kbd>cw</kbd> <kbd>ciw</kbd>…", "Change commands also go to <code>\"d</code>"], ["Visual <kbd>p</kbd>", "Not remapped: the replaced text overwrites the clipboard. Use Visual <kbd>P</kbd> to keep it"]], "note": "<code>lua/keymaps.lua:17-28</code>", "keys": ["d", "D", "c", "C", "x", "X", "p"]},
{"title": "j k and arrows move by display line", "kind": "change", "lead": "'wrap' is on, so long lines span several screen rows.", "rows": [["<kbd>j</kbd> <kbd>k</kbd> <kbd>&lt;Down&gt;</kbd> <kbd>&lt;Up&gt;</kbd>", "No count: like <kbd>gj</kbd>/<kbd>gk</kbd>, one wrapped screen row at a time"], ["<kbd>5j</kbd> <kbd>12k</kbd>", "With a count: real lines, so relative numbers still line up"], ["<kbd>1j</kbd>", "A real line down even on wrapped text (useful in macros)"], ["<kbd>dj</kbd> <kbd>yk</kbd>", "Operator-pending is not mapped: still linewise"], ["Insert <kbd>&lt;Down&gt;</kbd> <kbd>&lt;Up&gt;</kbd>", "Display-line moves too, unless a completion menu is open"]], "note": "A recorded macro that uses a bare <kbd>j</kbd> moves by screen row on wrapped lines; use <kbd>+</kbd> or <kbd>1j</kbd>. <code>lua/keymaps.lua:36-52</code>", "keys": ["j", "k", "<Down>", "<Up>"]},
{"title": "Enter does not work in quickfix and q: windows", "kind": "warn", "lead": "The global <code>&lt;CR&gt;</code> map wins because those windows have no buffer-local <code>&lt;CR&gt;</code> map.", "rows": [["Quickfix / location list <kbd>&lt;CR&gt;</kbd>", "Starts a Leap instead of opening the entry under the cursor"], ["Command-line window <kbd>q:</kbd> <kbd>q/</kbd> <kbd>&lt;CR&gt;</kbd>", "Starts a Leap instead of running the line"], ["Instead", "<code>:.cc</code> / <code>:.ll</code>, <kbd>&lt;C-W&gt;&lt;CR&gt;</kbd> (opens the entry in a split), or <kbd>i</kbd> then <kbd>&lt;CR&gt;</kbd> in <kbd>q:</kbd>"], ["Fix", "Map <kbd>&lt;CR&gt;</kbd> back buffer-locally on <code>FileType qf</code> and <code>CmdwinEnter</code>, or pick a different Leap key"]], "note": "Verified headless for both windows. <code>lua/keymaps.lua:352</code>", "keys": ["<CR>"]},
{"title": "LSP keys open Snacks pickers", "kind": "change", "rows": [["<kbd>gd</kbd> <kbd>gD</kbd> <kbd>gI</kbd> <kbd>gy</kbd>", "Definition, declaration, implementation, type definition"], ["<kbd>grr</kbd> <kbd>gai</kbd> <kbd>gao</kbd>", "References, incoming calls, outgoing calls"], ["<kbd>&lt;leader&gt;ss</kbd> <kbd>&lt;leader&gt;sS</kbd>", "Document / workspace symbols"], ["<kbd>grn</kbd> <kbd>gra</kbd> <kbd>gri</kbd> <kbd>grt</kbd> <kbd>grx</kbd>", "Neovim's own LSP keys: rename, code action, implementation, type definition, run code lens"], ["<kbd>K</kbd> <kbd>&lt;leader&gt;ca</kbd> <kbd>&lt;leader&gt;cr</kbd>", "Hover, code action, rename (IncRename with live preview)"], ["Lost", "Vim's search-based <kbd>gd</kbd>/<kbd>gD</kbd> (work without LSP), <kbd>gI</kbd> (use <kbd>0i</kbd>), and <kbd>K</kbd>'s <code>'keywordprg'</code> (use <code>:Man</code> / <code>:help</code>)"]], "note": "Global maps, active in every buffer; without an LSP client they find nothing. <code>lua/keymaps.lua:233-276</code>", "keys": ["gd", "gD", "gI", "gy", "grr", "grn", "gra", "gai", "gao", "K"]},
{"title": "Tab is Sidekick's next-edit suggestion", "kind": "change", "lead": "Copilot runs as an LSP server; ghost text comes from <code>vim.lsp.inline_completion</code>.", "rows": [["Normal <kbd>&lt;Tab&gt;</kbd>", "Jump to the next-edit suggestion, press again to apply it; with none, a plain jump forward"], ["Insert <kbd>&lt;Tab&gt;</kbd>", "In order: next snippet placeholder, Sidekick NES jump/apply, accept the Copilot ghost text, else a normal Tab"], ["<kbd>&lt;C-I&gt;</kbd>", "Mapped to itself, so where the terminal tells it apart from <kbd>&lt;Tab&gt;</kbd> (kitty, Neovide) it is always jump forward"]], "note": "<code>lua/keymaps.lua:338-347</code>; Insert chain <code>lua/plugins.lua</code> (blink <code>keymap</code>); see <code>:help CTRL-I</code>", "keys": ["<Tab>", "<C-I>"]},
{"title": ":Q writes everything and quits", "kind": "change", "rows": [["<code>:Q</code>", "Runs <code>:xa!</code>: write all changed buffers, read-only ones too, then quit"], ["Still blocked by", "Unnamed buffers or files that cannot be written"]], "note": "<code>lua/keymaps.lua:58</code>", "keys": [":Q"]},
{"title": "Files save themselves", "kind": "change", "lead": "Only normal file buffers (empty 'buftype').", "rows": [["Leaving Insert mode", "<code>:update</code> (only if modified)"], ["Any Normal-mode change", "<kbd>x</kbd>, <kbd>dd</kbd>, <kbd>p</kbd>, <kbd>u</kbd>, <kbd>.</kbd>… also save at once"], ["<code>'autowrite'</code>", "On: <code>:make</code>, <code>:next</code>, <kbd>&lt;C-]&gt;</kbd>… write first"], ["Undo", "Persistent ('undofile'): <kbd>u</kbd>, <kbd>&lt;leader&gt;uu</kbd> undotree, <kbd>&lt;leader&gt;su</kbd> picker; <code>:e!</code> cannot revert what is already saved"]], "note": "Each save also runs format-on-save, see the next card. <code>lua/options.lua:25</code>, <code>:34</code>, <code>:38-47</code>", "keys": ["u"]},
{"title": "Formatting", "kind": "tip", "rows": [["On save", "conform formats every write (<code>format_on_save</code>, 500 ms); autosave makes that after each change. Turn off with <code>vim.g.disable_autoformat</code> / <code>vim.b.disable_autoformat</code>"], ["<kbd>&lt;leader&gt;cf</kbd>", "Format the buffer; in Visual mode only the selected lines"], ["<code>:Format</code> <code>:'&lt;,'&gt;Format</code>", "Same, async, optional range"], ["Formatters", "stylua (Lua), clang-format (C/C++), rustfmt, ruff_format (Python), fish_indent, shfmt (sh/bash). Install them yourself (PATH or <code>:MasonInstall</code>): mason-lspconfig only installs LSP servers"], ["Other filetypes", "LSP formatting when the server supports it (<code>lsp_format = \"fallback\"</code>)"]], "note": "<code>lua/plugins.lua:249-268</code>; <code>lua/keymaps.lua:363-365</code>; <code>lua/options.lua:69-79</code>", "keys": ["<Space>cf"]},
{"title": "Working directory follows the buffer", "kind": "change", "rows": [["On <code>BufEnter</code>", "<code>:cd</code> to the project root of the file (global, all windows)"], ["Root markers", "Tried in order over all parent dirs: <code>.git</code>, then <code>lua</code>, <code>package.json</code>, <code>go.mod</code>, <code>Cargo.toml</code>, <code>Makefile</code>; else the file's own directory"], ["Affects", "<kbd>&lt;leader&gt;ff</kbd>, <kbd>&lt;leader&gt;/</kbd>, <kbd>&lt;leader&gt;sr</kbd>, <code>:e relative/path</code>, new terminals, <code>:make</code>"], ["Skipped", "Special buffers (help, terminals, pickers), except the Snacks explorer"]], "note": "<code>lua/options.lua:100-124</code>; marker order per <code>vim.fs.root()</code>"},
{"title": "Small automatic behaviours", "kind": "change", "rows": [["Reopen a file", "Cursor returns to where you left it (<kbd>g`\"</kbd>), <code>lua/options.lua:82-91</code>"], ["File changed outside", "Reloaded on focus and when idle (<code>checktime</code> on FocusGained/CursorHold, 'updatetime' 200 ms) if the buffer has no unsaved edits, <code>lua/options.lua:50-63</code>"], ["Line numbers", "Absolute current line + relative others, made for counts like <kbd>5j</kbd>, <code>lua/options.lua:26-27</code>"], ["Indent", "2 spaces, 'expandtab', <code>lua/options.lua:19-21</code>"], ["Terminal title", "<code>NVIM: file</code>, reset to the shell name on exit, <code>lua/options.lua:139-192</code>"]]},
{"title": "]] and [[ jump between references", "kind": "change", "rows": [["<kbd>]]</kbd> <kbd>[[</kbd>", "Next / previous LSP reference of the word under the cursor (Snacks words, counts work)"], ["Markdown buffers", "Buffer-local ftplugin maps win: next / previous heading"], ["Terminal buffers (Normal mode)", "Neovim's buffer-local defaults win: previous / next shell prompt"], ["Section motions", "Still available in Visual and Operator-pending mode (<kbd>v]]</kbd>, <kbd>d]]</kbd>)"]], "note": "<code>lua/keymaps.lua:315-320</code>", "keys": ["]]", "[["]},
{"title": "Terminal and scratch", "kind": "tip", "rows": [["<kbd>&lt;C-/&gt;</kbd>", "Toggle a floating terminal (Normal and Terminal mode; <kbd>&lt;C-_&gt;</kbd> in legacy terminals)"], ["<kbd>&lt;C-\\&gt;&lt;C-N&gt;</kbd>", "Terminal mode to Normal mode (built-in)"], ["<kbd>&lt;leader&gt;gg</kbd>", "Lazygit in a floating terminal"], ["<kbd>&lt;leader&gt;.</kbd> <kbd>&lt;leader&gt;S</kbd>", "Toggle / pick a persistent scratch buffer"]], "note": "<code>lua/keymaps.lua:285-314</code>; <code>lua/plugins.lua:106-120</code>", "keys": ["<C-/>", "<C-_>"]},
{"title": "Picker extras from this config", "kind": "tip", "rows": [["<kbd>s</kbd> (input, Normal)", "Flash labels on the result list: jump to an item in 2 keys"], ["<kbd>&lt;A-s&gt;</kbd>", "The same from Insert mode"], ["<kbd>&lt;A-a&gt;</kbd>", "Send the item(s) to the Sidekick AI CLI"], ["Matching", "Fuzzy, smart-case, frecency and cwd bonus"]], "note": "<code>lua/plugins.lua:46-91</code>", "keys": ["<A-s>", "<A-a>"]},
{"title": "Sessions and bookmarks", "kind": "tip", "rows": [["<kbd>&lt;leader&gt;qs</kbd> <kbd>&lt;leader&gt;ql</kbd> <kbd>&lt;leader&gt;qS</kbd>", "Restore the session for this directory + git branch, the last one, or pick one"], ["<kbd>&lt;leader&gt;qd</kbd>", "Do not save this session on exit (saved automatically otherwise)"], ["<kbd>&lt;leader&gt;ha</kbd>", "Bookmark the line with a note (virtual text), <kbd>&lt;leader&gt;ht</kbd> shows/hides it"], ["<kbd>&lt;leader&gt;hn</kbd> <kbd>&lt;leader&gt;hp</kbd> <kbd>&lt;leader&gt;hl</kbd>", "Next / previous bookmark, bookmark picker"]], "note": "<code>lua/keymaps.lua:382-416</code>; <code>lua/plugins.lua:133-138</code>, <code>:541-546</code>", "keys": ["<Space>qs", "<Space>ha"]},
{"title": "Neovide-only clipboard keys", "kind": "tip", "rows": [["<kbd>&lt;C-S-v&gt;</kbd>", "Paste the clipboard in every mode (Normal: an empty line is replaced)"], ["<kbd>&lt;C-S-c&gt;</kbd>", "Copy the selection, or the current line in Normal mode"], ["<kbd>&lt;C-S-x&gt;</kbd>", "Cut the selection or line to the clipboard (bypasses the <code>\"d</code> remap)"]], "note": "<code>lua/options.lua:198-242</code>; only when <code>vim.g.neovide</code> is set.", "keys": ["<C-S-V>", "<C-S-C>", "<C-S-X>"]}
]
}