Vim Recall繁體中文

Delete to the next word

dw

Example

Normal 0 / 2
one two
Cursor on line 1, column 1

Delete from the cursor to the next word start.

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
- Small delete register
CharacterwiseEmpty
· space ⇥ tab ↵ line break
Before & after
Before
one two
Cursor on line 1, column 1

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
- Small delete register
CharacterwiseEmpty
· space ⇥ tab ↵ line break
After
two
Cursor on line 1, column 1

Vim registers

" Unnamed register Changed
Characterwise · Uses Small delete registerone·
- Small delete register Changed
Characterwiseone·
· space ⇥ tab ↵ line break

Start in Normal mode. Cursor starts on o. Press dw.

Details & Vim help

Example replayed in Vim

Delete from the cursor to the next word start.

Combine the delete operator with the w motion. Starting at the first letter usually removes the word and its following spaces; line-boundary rules can change the range. A count such as 3dw extends the motion.