← Back to overview

Modes in Detail

Normal Mode

Default mode. You start here. Keys execute commands — moving the cursor, deleting text, copying, pasting, etc.

  • Press Esc or Ctrl-[ to return to Normal mode from any other mode.
  • This is where you spend most of your time (counterintuitively).

Insert Mode

Typing text. Behaves like a conventional editor.

Enter Insert mode with:

KeyAction
iInsert before cursor
IInsert at beginning of line
aAppend after cursor
AAppend at end of line
oOpen new line below
OOpen new line above
sDelete character and insert
SDelete line and insert
CDelete to end of line and insert

Visual Mode

Selecting text. Similar to selecting with a mouse, but with keyboard precision.

KeyAction
vCharacter-wise visual selection
VLine-wise visual selection
Ctrl-vBlock-wise visual selection (column selection)

Once text is selected, you can operate on it: d to delete, y to yank (copy), > to indent, etc.

Command-Line Mode

Ex commands. Press : from Normal mode to enter the command line at the bottom of the screen.

Examples:

  • :w — write (save) the file
  • :q — quit
  • :wq or :x — save and quit
  • :q! — quit without saving
  • :%s/old/new/g — replace all occurrences

Replace Mode

Like Insert mode, but each typed character overwrites the existing character. Enter with R from Normal mode.