Basic Vim Usage

Vim is a modal editor. Start by learning mode switching and basic operations.

Modes

Normal: Command input. Most keys run commands. Insert: Text input. Press i or a to enter. Visual: Range selection. Press v or V to enter.

Inserting text

Press i in Normal to enter Insert. Type your text, then Esc to return to Normal. a inserts after the cursor, o inserts on the next line.

Save and quit

:w saves, :q quits (warns if unsaved). :wq saves and quits. :q! force quits (discards changes).

Cursor movement

h left, j down, k up, l right. w jumps to next word start, b backward. 0 to line start, $ to line end. gg to first line, G to last line.

Basic editing

dd deletes line, yy yanks (copies) line. p pastes. u undoes. x deletes one character.

← Getting Started | Next: 2. Main Features →