
Mode badge in the SQL editor
Modes
gi puts you back where you last left insert.
Move the cursor
Characters
Words
Lines
Find a character
Sentences and paragraphs
Counts work:
3w moves three words, 5j moves five lines down.
Edit
2d3w deletes six words. 3yy yanks three lines. 5>> indents five lines.
Yank, delete, and change all write to the system clipboard.
Text objects
Use afterd, c, y, or in visual mode.
ciw rewrites the current word. da" removes a quoted string and its trailing space. yip copies the current paragraph.
Paste
In visual mode,
p and P replace the selection with the register.
Registers
Prefix with"{a-z} to pick a register.
"ayy stores a line in a. "ap pastes it back later.
Marks
Marks shift when you insert or delete text before them.
Search
The pattern is a literal, case-sensitive substring, not a regex. Searches wrap around.
Repeat and undo
5. repeats the last change five times.
Macros
Recursion is capped at 50 to keep self-calling macros safe.
Control keys
Ctrl+R in normal mode is the only control combination vim mode intercepts. It redoes.
Every other control combination passes straight through to the editor, which applies its own binding:
- No scrolling from the keyboard.
Ctrl+D,Ctrl+U,Ctrl+F,Ctrl+B,Ctrl+E, andCtrl+Ydo not move the viewport.Ctrl+Ddeletes the character after the cursor andCtrl+Ejumps to the end of the paragraph. - No increment or decrement.
Ctrl+AandCtrl+Xleave the number under the cursor alone;Ctrl+Ajumps to the start of the paragraph. - No insert-mode editing keys.
Ctrl+W,Ctrl+U,Ctrl+T, andCtrl+Ddo not delete a word, delete to line start, indent, or outdent.Ctrl+Hstill backspaces, through the editor’s binding rather than vim’s.
zt, zz, and zb are swallowed without moving the viewport.
Visual mode
Motions extend the selection. Then:
Indent and outdent work in normal mode only (
>>, <<, >{m}, <{m}).
Insert mode
Esc goes back to normal mode. Nothing else is intercepted while you type; see Control keys.
Command line
/ and ? are search. Other : commands, including :wq and :x, are parsed and ignored.
