Skip to main content
Vim mode is scoped to the SQL editor. The data grid, the find field and every other control in the window keep their own keys, and a Cmd or Option chord passes through in any mode, so Cmd+Enter still runs the query. Turn it on in Settings > Editor > Vim mode, which is also the only way to turn it off: there is no :set. 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

A macro that calls itself stops after 50 rounds.

Control keys

Ctrl+R in normal mode is the only control combination vim mode intercepts, and it redoes. Every other one reaches the editor and gets the editor’s own binding, so these vim meanings are not available: zt, zz and zb are read and discarded, so there is no way to move the viewport from the keyboard at all.

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. Every other : command is parsed and ignored, :wq, :x and :set among them. :10 does not jump to line 10 either; use 10G or 10gg.