Skip to main content
Turn on vim mode in Settings > Editor > Vim mode. A badge next to the editor shows the current mode.
Vim mode badge

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 after d, 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. 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, and Ctrl+Y do not move the viewport. Ctrl+D deletes the character after the cursor and Ctrl+E jumps to the end of the paragraph.
  • No increment or decrement. Ctrl+A and Ctrl+X leave the number under the cursor alone; Ctrl+A jumps to the start of the paragraph.
  • No insert-mode editing keys. Ctrl+W, Ctrl+U, Ctrl+T, and Ctrl+D do not delete a word, delete to line start, indent, or outdent. Ctrl+H still 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.