Vim Recall繁體中文

Change from the cursor to the word end

cw

Example

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

On a word, change from the cursor through its last character.

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
red two
Cursor on line 1, column 3

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. Type cwred, then Esc.

Details & Vim help

Example replayed in Vim

On a word, change from the cursor through its last character.

On a nonblank character, cw keeps the whitespace after the word. At the word’s last character, cw changes just that character. ce continues to the next word end. On whitespace, cw follows w with standard Vim settings. Type the replacement and press Esc.