Vim Insert Mode — i, a, o, I, A, O and Insert Commands

Learn all the ways to enter Insert mode in Vim: i, a, o, I, A, O, and the essential Insert mode commands for editing, autocompletion, and returning to Normal mode.

Insert Mode

Detailed Explanation

Entering Insert Mode

Vim offers multiple entry points to Insert mode, each positioning the cursor differently:

Basic Entry Commands

Key Action
i Insert before cursor
I Insert at the beginning of the line (first non-blank)
a Append after cursor
A Append at the end of the line
o Open a new line below and enter Insert mode
O Open a new line above and enter Insert mode

Additional Entry Commands

Key Action
s Substitute character (delete char, enter Insert)
S Substitute entire line (same as cc)
C Change from cursor to end of line (same as c$)
gi Enter Insert mode at the position where it was last exited

Inside Insert Mode

Once in Insert mode, these shortcuts are available:

Key Action
Esc or Ctrl+[ Return to Normal mode
Ctrl+w Delete the word before the cursor
Ctrl+u Delete from cursor to beginning of line
Ctrl+t Indent current line
Ctrl+d Unindent current line
Ctrl+n Autocomplete — next match
Ctrl+p Autocomplete — previous match
Ctrl+o Execute one Normal mode command, then return to Insert
Ctrl+r {reg} Insert contents of register

Pro Tip: Ctrl+o

Ctrl+o is one of the most underused Insert mode features. It lets you execute a single Normal mode command without leaving Insert mode. For example, Ctrl+o $ moves to end of line while staying in Insert mode.

Use Case

You need to understand all the ways to start typing text in Vim, along with the editing shortcuts available inside Insert mode to avoid constantly switching back to Normal mode.

Try It — Vim Cheat Sheet

Open full tool