Mission 15 / 52• Basic Operators

Change Words

In many editors, changing a word takes: select word, delete, and type. In Vim, `cw` does all three in two keystrokes.

The `c` (change) operator deletes the target and automatically switches to insert mode.

Change word commands

  • cwchange to the end of the word and enter insert mode
  • cechange to the end of the current word
  • c$change from cursor to the end of the line
1
const firstName = "Alice";
2
const role = "guest";

Move to `guest`, press `cw`, type `admin`, then press `esc`. You replaced the word in a single breath.

Now it's your turn!

0 / 4 tasks complete0.0s / 25s par0 / 42 par

Practice this lesson's commands. Each task checks your technique and the result, not just your cursor position. Take your time.

Task 1: Change idle to ready with ce while preserving its space. Return to normal mode.

Expected result
ready state
Show hint

Use ce, type ready, then Escape.

1
idle state
jkscroll•ggGtop/bottom•Tabnext example•Enterstart•qstop•Ctrl+kCtrl+jprev/next