Learn Vim / How to Type and Insert Text in Vim

How to Type and Insert Text in Vim

The answerPress i to enter insert mode before the cursor, type your text, then press Esc to return to normal mode.

Try it on a real buffer

Line 2 should say “learning vim.” — press j to drop to line 2, i to insert before the cursor, type v, then Esc.

Other editors made me reach for the mouse.
I am learning im.
Soon my hands will never leave the keyboard.

Canonical solution: j, i, v, Esc · target: 4 keystrokes — the fewest that solve it (every keypress counts).

Why it works

i drops you into insert mode just before the cursor. Esc (or Ctrl-[) takes you back to normal mode. In and out, fast — vim users spend most of their time in normal mode.

Variations

KeysWhat it does
iinsert before the cursor
ainsert after the cursor
Iinsert at the start of the line
Ainsert at the end of the line
Escback to normal mode — always
▶ live vim buffertarget 4 keystrokes
Line 2 should say “learning vim.” — press j to drop to line 2, i to insert before the cursor, type v, then Esc.

Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “Enter insert mode” mission takes about a minute.

Sign in free to practice →

Keep going