editing

i / a / o / O

The four ways to enter insert mode: i inserts BEFORE the cursor, a inserts AFTER it, o opens a new line BELOW and enters insert mode, O opens a new line ABOVE. Choosing the right one saves a motion or two before you start typing.

i  a  o  O  (normal mode → insert mode)

Variations

Keystroke Effect
I Insert at first non-blank character of line
A Append at end of line (very common)
gi Re-enter insert mode at the last place you left it
5i-<Esc> Prefix count: insert '-' five times then leave insert mode → -----

Examples

A;<Esc>

Jump to end of line, append a semicolon, return to normal mode

o

Create a new line below current and start typing

O

Create a new line ABOVE and start typing

Gotcha

a puts the cursor AFTER the current character — at end of line, use A instead of a (a on the last char is fine, but A is clearer).

Related

← All Vim commands · Vim cheat sheet