More Ways into Insert
Five doors into insert mode โ pick the one that lands the cursor where you want.
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.
| Key | Note |
|---|---|
| i |
| Key | Note |
|---|---|
| a |
| Key | Note |
|---|---|
| I |
| Key | Note |
|---|---|
| A |
| Key | Note |
|---|---|
| o |
| Key | Note |
|---|---|
| O |
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.
[missing screenshot editing.insert-variants/frame_01.color.svg โ run python content/render_screenshots.py]
[missing screenshot editing.insert-variants/frame_02.color.svg โ run python content/render_screenshots.py]
Cursor jumps before 'i' (column 4) and Insert begins. I = ^i.
[missing screenshot editing.insert-variants/frame_03.color.svg โ run python content/render_screenshots.py]
A jumps past the last char. Pair with I for boundary insertions; pair with o/O for new lines.
See also: Insert and Back Again, Line Motions, The Universal Grammar