Yank the text covered by the motion [into register x]
y{motion}
Example
Normal 0 / 2Operator pending 1 / 2Normal 2 / 2One TWO
three four
keepCursor on line 1, column 1One TWO
three four
keepCursor on line 1, column 1One TWO
three four
keepCursor on line 1, column 1Yank the text covered by the motion [into register x].
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
Command applied
Vim registers
"Unnamed register Changed- Characterwise · Uses Yank register 0
One· 0Yank register 0 Changed- Characterwise
One·
Before & after
One TWO
three four
keepCursor on line 1, column 1Vim registers
"Unnamed register- Characterwise · Uses Yank register 0
saved 0Yank register 0- Characterwise
saved
One TWO
three four
keepCursor 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. The key buttons show a concrete motion in place of {motion}. Indentation uses shiftwidth=2.
Details & Vim help
Example replayed in Vim
Yank the text covered by the motion [into register x]. Use in Normal mode. Braced names stand for the required argument and are not typed literally. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.