Skip to main content

Vim Mode

Modal editing in the SQL editor. The current mode shows in the editor status bar.

Enable

Open Settings (Cmd+,) > Editor and toggle Vim mode. The mode indicator (NORMAL, INSERT, VISUAL, VISUAL LINE) appears next to the editor when the toggle is on.

Modes

ModeEnterUse for
NormalEscNavigation, deletion, yank
Inserti, a, o, I, A, OTyping SQL
VisualvCharacter-wise selection
Visual LineVLine-wise selection
Command-line: or /Run a command or start a search

Motions

KeyMotion
h j k lLeft, down, up, right
wNext word start
bPrevious word start
eWord end
0Line start
^ _First non-blank on line
$Line end
ggBuffer start
GBuffer end
{count}GLine {count}
Counts work with motions: 5j moves down five lines, 3w moves three words forward.

Operators

KeyAction
dDelete (with motion)
ddDelete line
cChange (with motion)
ccChange line
yYank (with motion)
yyYank line
xDelete character under cursor
pPaste after cursor
PPaste before cursor
uUndo
Ctrl+rRedo
Operators combine with motions: dw deletes to next word, c$ changes to end of line, y3j yanks the next three lines. Yank, delete, and change all sync to the system pasteboard.

Visual Mode

In Visual or Visual Line mode the same motion keys extend the selection. Press d, c, or y to operate on the selection. Press v or V again to leave the mode, or Esc to cancel.

Command-line

CommandAction
:wExecute the current query
:qClose the current tab
Other command-line input is parsed but ignored.