More Ways into Insert

Five doors into Insert mode โ€” pick the one that lands the cursor where you want.

Keys: i, a, I, A, o, O

i and a are the two basic doors into Insert mode. I, A, o, O are the convenience doors that combine a motion with the entry.

i inserts before the cursor. a appends after. That covers most of life โ€” but Vim gives you four more doors that do a useful little motion on the way in.

Insert before cursor
KeyNote
i
Append after cursor
KeyNote
a
Insert at first non-blank of line
KeyNote
I
Append at end of line
KeyNote
A
Open new line below, insert
KeyNote
o
Open new line above, insert
KeyNote
O
a โ€” append after cursor
I โ€” insert at first non-blank
A โ€” append at end of line
o โ€” open line below
O โ€” open line above

Reference

Key Where the cursor lands Equivalent
i Before cursor โ€”
a After cursor โ€”
I First non-blank of line ^i
A End of line $a
o New line below current $aEnter
O New line above current 0iEnterUp
gi Last place you left Insert mode โ€”

Worked example โ€” i I a A o O

Six entries to Insert mode.

Step 1 ยท Cursor middle of line.
Cursor middle of line.
Step 2 ยท I ยท I โ€” first non-blank.
I โ€” first non-blank.

Cursor jumps before 'i' (column 4) and Insert begins. I = ^i.

Step 3 ยท Esc A ยท A โ€” end of line.
A โ€” end of line.

A jumps past the last char. Pair with I for boundary insertions; pair with o/O for new lines.

โ–ถ Try this in the simulator

See also: Insert and Back Again, Line Motions, The Universal Grammar