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).
66 lines
11 KiB
JSON
66 lines
11 KiB
JSON
{
|
|
"map_desc": [
|
|
{"s": "config", "m": "n", "k": "<leader>.", "cat": "Buffer & tab", "sl": "scratch", "n": "Toggle a persistent scratch buffer (Snacks)"},
|
|
{"s": "config", "m": "n", "k": "<leader>S", "cat": "Buffer & tab", "sl": "scratches", "n": "Pick one of the saved scratch buffers"},
|
|
{"s": "config", "m": "n", "k": "<leader>sa", "cat": "Help", "sl": "autocmds", "n": "Snacks picker of every autocommand; <kbd><CR></kbd> jumps to where it was defined"},
|
|
{"s": "config", "m": "n", "k": "<leader>si", "cat": "Insert", "sl": "icons", "n": "Snacks icon picker; <kbd><CR></kbd> puts the icon at the cursor (<code>confirm = \"put\"</code>)"},
|
|
{"s": "snacks", "m": "x", "k": "ii", "d": "Inner scope: the indented block around the cursor, without its header/footer", "cat": "Text object", "n": "Snacks scope (loaded on UIEnter, so the headless key dump misses it). Tested: inside an <code>if</code> body, <kbd>yii</kbd> yanks the body lines", "sl": "in scope", "force": true},
|
|
{"s": "snacks", "m": "o", "k": "ii", "d": "Inner scope: the indented block around the cursor, without its header/footer", "cat": "Text object", "n": "Snacks scope (loaded on UIEnter, so the headless key dump misses it). Tested: inside an <code>if</code> body, <kbd>yii</kbd> yanks the body lines", "sl": "in scope", "force": true},
|
|
{"s": "snacks", "m": "x", "k": "ai", "d": "Full scope: the indented block plus its header and closing lines", "cat": "Text object", "n": "Tested: inside an <code>if</code> body, <kbd>yai</kbd> yanks <code>if … end</code>; from the function body it takes the whole function", "sl": "a scope", "force": true},
|
|
{"s": "snacks", "m": "o", "k": "ai", "d": "Full scope: the indented block plus its header and closing lines", "cat": "Text object", "n": "Tested: inside an <code>if</code> body, <kbd>yai</kbd> yanks <code>if … end</code>; from the function body it takes the whole function", "sl": "a scope", "force": true},
|
|
{"s": "snacks", "m": "n", "k": "[i", "d": "Jump to the start of the current scope; repeat for the enclosing one", "cat": "Motion", "n": "Snacks scope, UI sessions only. Replaces Vim's <kbd>[i</kbd> (show the first line containing the keyword)", "sl": "scope↑", "force": true},
|
|
{"s": "snacks", "m": "x", "k": "[i", "d": "Jump to the start of the current scope; repeat for the enclosing one", "cat": "Motion", "n": "Snacks scope, UI sessions only. Replaces Vim's <kbd>[i</kbd> (show the first line containing the keyword)", "sl": "scope↑", "force": true},
|
|
{"s": "snacks", "m": "o", "k": "[i", "d": "Jump to the start of the current scope; repeat for the enclosing one", "cat": "Motion", "n": "Snacks scope, UI sessions only. Replaces Vim's <kbd>[i</kbd> (show the first line containing the keyword)", "sl": "scope↑", "force": true},
|
|
{"s": "snacks", "m": "n", "k": "]i", "d": "Jump to the end of the current scope", "cat": "Motion", "n": "Snacks scope, UI sessions only. Replaces Vim's <kbd>]i</kbd> (show the next line containing the keyword)", "sl": "scope↓", "force": true},
|
|
{"s": "snacks", "m": "x", "k": "]i", "d": "Jump to the end of the current scope", "cat": "Motion", "n": "Snacks scope, UI sessions only. Replaces Vim's <kbd>]i</kbd> (show the next line containing the keyword)", "sl": "scope↓", "force": true},
|
|
{"s": "snacks", "m": "o", "k": "]i", "d": "Jump to the end of the current scope", "cat": "Motion", "n": "Snacks scope, UI sessions only. Replaces Vim's <kbd>]i</kbd> (show the next line containing the keyword)", "sl": "scope↓", "force": true}
|
|
],
|
|
"entries": [
|
|
{"k": "`.", "m": ["n", "x", "o"], "s": "builtin", "cat": "Mark & jump", "h": "'.", "d": "Jump to where the last change was made (<kbd>'.</kbd> for its line)", "n": "For older changes use <kbd>g;</kbd> / <kbd>g,</kbd>"},
|
|
{"k": "`^", "m": ["n", "x", "o"], "s": "builtin", "cat": "Mark & jump", "h": "'^", "d": "Jump to where Insert mode was last stopped (<kbd>gi</kbd> also re-enters Insert)"},
|
|
{"k": "`\"", "m": ["n", "x", "o"], "s": "builtin", "cat": "Mark & jump", "h": "'quote", "d": "Jump to the cursor position when this buffer was last exited", "n": "This config jumps there automatically when a file is opened (<code>lua/options.lua:82-91</code>)"},
|
|
{"k": "`0", "m": ["n", "x", "o"], "s": "builtin", "cat": "Mark & jump", "h": "'0", "d": "Jump to where you were when Neovim last exited ('1 the time before, …)", "n": "Numbered marks come from the ShaDa file and can't be set by hand"},
|
|
{"k": "\"{1-9}", "m": ["n"], "s": "builtin", "cat": "Register & macro", "h": "quote_number", "d": "Last nine deletes of a line or more, newest in \"1 (still filled in this config)", "n": "Tested: <kbd>dd</kbd> fills both <code>\"d</code> and <code>\"1</code>, and the next <kbd>dd</kbd> shifts the old text to <code>\"2</code>"},
|
|
{"k": "\"-", "m": ["n"], "s": "builtin", "cat": "Register & macro", "h": "quote_-", "d": "Small-delete register: stays empty here because d/c/x always name register d", "n": "Vim skips <code>\"-</code> when a register is given; tested: <kbd>dw</kbd> fills <code>\"d</code>, not <code>\"-</code>"},
|
|
{"k": "\".", "m": ["n"], "s": "builtin", "cat": "Register & macro", "h": "quote_.", "d": "Last inserted text (read-only): \".p puts it again", "n": "Read-only registers <code>\".</code> <code>\"%</code> <code>\":</code> work with <kbd>p</kbd>, <kbd>P</kbd>, <code>:put</code> and <kbd><C-r></kbd>"},
|
|
{"k": "\"%", "m": ["n"], "s": "builtin", "cat": "Register & macro", "h": "quote_%", "d": "Name of the current file (read-only): \"%p, or <C-r>% in Insert mode"},
|
|
{"k": "\"=", "m": ["n"], "s": "builtin", "cat": "Register & macro", "h": "quote_=", "d": "Expression register: \"=5*7<CR>p puts 35; <C-r>=… inserts a result in Insert mode"},
|
|
{"k": "<CR>", "m": ["i"], "s": "builtin", "cat": "Command line", "h": "cmdwin", "ctx": "Command-line window (q: q/ <C-f>)", "d": "Run the line under the cursor (Normal-mode Enter is Leap here, so press i first)", "n": "Tested: <kbd>q:</kbd> <kbd>i</kbd> <code>let g:x=3</code> <kbd><CR></kbd> runs it"},
|
|
{"k": "<C-C>", "m": ["n", "i"], "s": "builtin", "cat": "Command line", "h": "cmdwin", "ctx": "Command-line window (q: q/ <C-f>)", "d": "Put the line under the cursor on the command line without running it", "n": "Edit further, then <kbd><CR></kbd> runs it from the normal command line (tested)"},
|
|
{"k": ":q", "m": [":"], "s": "builtin", "cat": "Command line", "h": "cmdwin", "ctx": "Command-line window (q: q/ <C-f>)", "d": "Close the command-line window without running anything (<C-w>c also works)"},
|
|
{"k": "<C-W><CR>", "m": ["n"], "s": "builtin", "cat": "Quickfix & lists", "h": "CTRL-W_<CR>", "ctx": "Quickfix / location-list window", "d": "Open the entry under the cursor in a new split", "n": "Works even though plain <kbd><CR></kbd> is Leap here (tested: opens the file at the entry's line)"},
|
|
{"k": "<C-V>{motion}$A{text}<Esc>", "m": ["n"], "s": "builtin", "cat": "Visual", "h": "v_b_A", "d": "Append {text} at the end of every selected line, even ragged ones", "n": "Without <kbd>$</kbd>, <kbd>A</kbd> appends at the block's right edge instead. Tested: <code>a / bbb / cc</code> + <kbd><C-v>jj$AX<Esc></kbd> → <code>aX / bbbX / ccX</code>"},
|
|
{"k": "<C-X><C-N>", "m": ["i"], "s": "builtin", "cat": "Completion & AI", "h": "i_CTRL-X_CTRL-N", "ctx": "This config (blink.cmp)", "d": "Built-in keyword completion through CTRL-X (plain <C-n>/<C-p> open blink's menu)", "n": "Tested with blink active: <kbd><C-x><C-n></kbd>, <kbd><C-x><C-p></kbd>, <kbd><C-x><C-l></kbd> (lines) and <kbd><C-x><C-f></kbd> (file names) complete"},
|
|
{"k": ":lua vim.pack.update()", "m": [":"], "s": "neovim", "cat": "Misc", "h": "vim.pack.update()", "d": "Fetch plugin updates and review them in a confirmation tab before applying", "n": "<code>vim.pack.update(nil, { offline = true })</code> just lists installed plugins. Plugins on disk but not added (here: <code>cord.nvim</code>, <code>git-blame</code>, <code>nvim-treesitter</code>) show as \"(not active)\""},
|
|
{"k": ":w", "m": [":"], "s": "neovim", "cat": "Misc", "h": "vim.pack.update()", "ctx": "vim.pack update tab", "d": "Apply the listed updates"},
|
|
{"k": ":q", "m": [":"], "s": "neovim", "cat": "Misc", "h": "vim.pack.update()", "ctx": "vim.pack update tab", "d": "Discard the updates and close the tab"},
|
|
{"k": "]]", "m": ["n", "x"], "s": "neovim", "cat": "Misc", "h": "vim.pack.update()", "ctx": "vim.pack update tab", "d": "Next plugin section ([[ for the previous one)", "n": "Buffer-local (<code>ftplugin/nvim-pack.lua</code>), so it wins over this config's Snacks reference jump"},
|
|
{"k": "K", "m": ["n"], "s": "neovim", "cat": "Misc", "h": "vim.pack.update()", "ctx": "vim.pack update tab", "d": "Details of the pending change or newer tag under the cursor (LSP hover)"},
|
|
{"k": "gra", "m": ["n"], "s": "neovim", "cat": "Misc", "h": "vim.pack.update()", "ctx": "vim.pack update tab", "d": "Plugin actions: update, skip updating, or delete a plugin that isn't active", "n": "Neovim's code-action key (<kbd><leader>ca</kbd> works too). Tested: on <code>cord.nvim</code> the actions are Update / Skip updating / Delete"},
|
|
{"k": ":checkhealth vim.lsp", "m": [":"], "s": "neovim", "cat": "LSP & diagnostics", "h": ":checkhealth", "d": "Show attached LSP clients, their configs and the log path (there is no :LspInfo)", "n": "nvim-lspconfig skips its <code>:LspInfo</code>/<code>:LspStart</code>/<code>:LspStop</code>/<code>:LspRestart</code>/<code>:LspLog</code> when Neovim has <code>:lsp</code> (<code>plugin/lspconfig.lua:6-8</code>); use <code>:lsp restart</code>, <code>:lsp stop</code>, <code>:lsp enable</code>"}
|
|
],
|
|
"commands": {
|
|
"Man": "Open a man page: :Man {name}, :Man {sect} {name}; no arg = word under cursor",
|
|
"Explore": "netrw: browse the current file's directory (or [dir]) in this window",
|
|
"Hexplore": "netrw: browse the directory in a horizontal split (! = above)",
|
|
"Lexplore": "netrw: toggle a full-height explorer on the left",
|
|
"Sexplore": "netrw: split, then browse the current file's directory (! = vertical)",
|
|
"Vexplore": "netrw: browse the directory in a vertical split",
|
|
"Texplore": "netrw: browse the directory in a new tab",
|
|
"Nexplore": "netrw: next file matched by :Explore **/pattern",
|
|
"Pexplore": "netrw: previous file matched by :Explore **/pattern",
|
|
"Ntree": "netrw: make [dirname] (or the line under the cursor) the tree top",
|
|
"Nread": "netrw: re-read the last remote file into this buffer",
|
|
"Nwrite": "netrw: write [range] to the last remote file",
|
|
"Nsource": "netrw: source a remote {netfile}",
|
|
"NetUserPass": "netrw: set the user id and password for remote (ftp) access",
|
|
"DoMatchParen": "Turn matching-paren highlighting back on",
|
|
"NoMatchParen": "Turn off highlighting of the matching paren under the cursor",
|
|
"MatchDisable": "matchit: drop its % g% [% ]% maps (plain bracket %)",
|
|
"MatchEnable": "matchit: restore its % g% [% ]% maps",
|
|
"MatchDebug": "matchit: debug b:match_words (adds a Matchit menu)",
|
|
"Tutor": "Open the interactive Vim tutorial (:Tutor {name} for others)",
|
|
"UpdateRemotePlugins": "Register remote (rplugin/) plugins; run after installing or updating one"
|
|
}
|
|
}
|