In vi normal mode, the cursor is on an existing character.
Enter insert mode starting immediately after that character.
Which key should be pressed first?
a is the append command: it enters insert mode after the cursor. i starts insertion before the cursor.
Detailed explanation
aCorrect. a appends by starting insertion one position after the cursor.
Correct. a enters insert mode after the cursor character.
iIncorrect. i starts insertion before the cursor position.
Incorrect. i inserts before the cursor character.
oIncorrect. o opens a new line below the current line.
Incorrect. o opens a separate line below the current line.
ESCIncorrect. ESC exits insert mode rather than entering it.
Incorrect. Escape leaves insert mode; it does not begin text entry.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp); printf 'ac\n' >"$tmp"; vim -Nu NONE -n -es "$tmp" +'normal 0ab' +wq; cat "$tmp"; rm -f "$tmp"Expected result
abcKey points
- a inserts after the cursor
- i inserts before the cursor
- ESC returns to normal mode
Notes
- Environment: Vim 9.x互換のvi操作 / 一時ファイル
- Use a temporary file and harmless edits when testing vi commands.
- Confirm the behavior on the target vi/Vim implementation.
Foundation review
Place the operation
The insertion command determines whether the existing cursor character is before or after the new text.
Check the side effect
Place the cursor on a known character and observe where the inserted text appears.