Mission 38 / 52• Text Objects - Words

Delete Inside Word

`diw` ('delete inside word') deletes the word under the cursor, leaving the surrounding spaces untouched.

Crucially, your cursor can be anywhere on the word: start, middle, or end.

Delete inside word

  • diwdelete the current word (preserves surrounding spaces)
1
const firstName = "Bob";
2
const totalAmount = 100;

Place cursor in the middle of `firstName` (e.g. on `s`) and press `diw`. Only the word identifier is deleted.

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
const firstName = "Bob";
2
const totalAmount = 100;
NORMAL
00:00