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
1const firstName = "Alice";2const 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!
- Navigate to each green target across the code snippet.
- Use the motions and techniques learned in this lesson to land accurately on each target.
- See how fast you can complete 10 targets.
0/10
1const firstName = "Alice";2const role = "guest";NORMAL
00:00
NextCtrl+jDelete Lines