Yank the current word
yiw
Example
Normal 0 / 2Operator pending 1 / 2Normal 2 / 2one twoCursor on line 1, column 2one twoCursor on line 1, column 2one twoCursor on line 1, column 1Copy the inner word without surrounding spaces.
Vim registers
"Unnamed register- Characterwise · Uses Yank register 0
saved 0Yank register 0- Characterwise
saved
Waiting for motion or text object
Vim registers
"Unnamed register- Characterwise · Uses Yank register 0
saved 0Yank register 0- Characterwise
saved
Copy the inner word without surrounding spaces
Vim registers
"Unnamed register Changed- Characterwise · Uses Yank register 0
one 0Yank register 0 Changed- Characterwise
one
Before & after
one twoCursor on line 1, column 2Vim registers
"Unnamed register- Characterwise · Uses Yank register 0
saved 0Yank register 0- Characterwise
saved
one twoCursor on line 1, column 1Vim registers
"Unnamed register Changed- Characterwise · Uses Yank register 0
one 0Yank register 0 Changed- Characterwise
one
Start in Normal mode. Cursor starts on n. Press yiw; the unnamed register contains "one".
Details & Vim help
Example replayed in Vim
Copy the inner word without surrounding spaces.
Combine y with iw to copy the complete word from anywhere inside it. The buffer stays unchanged.