y
The
Operator
The y command in Vim
Operator
yank
Yank (copy) the text covered by the motion into a register. Double
yy yanks the whole line. Paste with p or P.Examples
yy or Y (yank line)yw(yank word)y$(yank to end of line)yiw(yank inner word)"ay$(yank to register a)
Related plugin
tpope/vim-surround — ys{motion}{char} adds surrounding. e.g. ysiw" wraps word in quotes, yss( wraps whole line in parens, ysip} wraps paragraph in braces.
Reference
Learn every Vim command visually — right in your browser.
Add Vim What? to Chrome — FreeAlso on Firefox.
Related operators