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 appends by starting insertion one position after the cursor.
iIncorrect. i starts insertion before the cursor position.
Incorrect. i starts insertion before the cursor position.
oIncorrect. o opens a new line below the current line.
Incorrect. o opens a new line below the current line.
ESCIncorrect. ESC exits insert mode rather than entering it.
Incorrect. ESC exits insert mode rather than entering it.
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操作 / 一時ファイル
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.