Mission 05 / 52• Insert Like a Pro

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.

1
function calculateTotal(items) {
2
const sum = items.reduce((acc, x) => acc + x, 0)
3
return sum
4
}

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.

Tip: Whenever you find yourself pressing `l` or `w` repeatedly to reach a line boundary, stop and ask: can I use I or A instead?

Now it's your turn!

0 / 6 tasks complete0.0s / 31s par0 / 45 par

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();
jkscroll•ggGtop/bottom•Tabnext example•Enterstart•qstop•Ctrl+kCtrl+jprev/next