Uppercase Commands
In Vim, almost every lowercase movement or command has an uppercase twin.
Shift acts as an amplifier or directional inverse. While lowercase keys often perform local, one-step actions, uppercase letters take the action to the extreme or opposite direction.
Uppercase multipliers
- Iinsert at the beginning of the line (before first non-blank character)
- Aappend at the very end of the line
- Oopen a new line ABOVE current line
- Ddelete from cursor to the end of the line (d$)
- Cchange from cursor to the end of the line (c$)
Remember: uppercase commands are fast lanes that avoid multiple cursor hops.
1function calculateTotal(items) {2 const sum = items.reduce((acc, x) => acc + x, 0)3 return sum4}Try adding a semicolon at the end of the return statement: move your cursor anywhere on `return sum`, press capital `A`, type `;`, and press `esc`.
Notice you didn't have to step across the line character by character. Capital `A` takes you straight to the end in one leap.
Now it's your turn!
Practice this lesson's commands. Each task checks your technique and the result, not just your cursor position. Take your time.
Task 1: Add // prepare above with O, preserving indentation. Return to normal mode.
Expected result
// prepare validate(); ship();
Show hint
Press O, type // prepare, then Escape.
1 validate();2 ship();