Mission 40 / 52• Text Objects - Words

Change Inside Word

Unlike `cw` (which only changes from the cursor to the end of the word), `ciw` changes the *whole* word regardless of where cursor is situated.

Change inside word

  • ciwchange the entire word under cursor and enter insert mode
  • cawchange word and its adjacent space
1
function calculateSubtotal(items) {
2
return items.length;
3
}

Place your cursor on `Subtotal`, press `ciw`, type `Total`, and press `esc`. The entire identifier was replaced seamlessly.

Now it's your turn!

  1. Navigate to each green target across the code snippet.
  2. Use the motions and techniques learned in this lesson to land accurately on each target.
  3. See how fast you can complete 10 targets.
0/10
1
function calculateSubtotal(items) {
2
return items.length;
3
}
NORMAL
00:00
NextCtrl+jWords Review