How do I copy an entire line in Vim?
yy
The yy command yanks (copies) the entire current line, including the newline character.
20 results for "yy"
yy
The yy command yanks (copies) the entire current line, including the newline character.
"+yy
The "+yy command yanks the current line directly to the system clipboard register, making it available for pasting in other applications.
p
The p command pastes (puts) the contents of the default register after the cursor.
yyp
The yyp command duplicates the current line by yanking it and immediately pasting it below.
"_d
The "d command deletes text using the black hole register ("), which discards the deleted content instead of storing it.
<C-w>N
When using Vim's built-in :terminal, the buffer is in Terminal-Job mode by default, meaning all keystrokes go to the running shell.
gp
The standard p command pastes text after the cursor but leaves the cursor at the beginning of the pasted text.
"+y and "+p
The "+ register is linked to the system clipboard.
P
The P (uppercase) command pastes the contents of the default register before the cursor position.
"ayy ... "ap
Named registers let you store multiple pieces of text independently.
:let @+ = @"
Vim's :let @{reg} syntax lets you read from one register and write to another.
guu / gUU
Vim's case operators gu (lowercase) and gU (uppercase) follow the same doubling convention as dd and yy: repeating the operator letter applies it to the whole c
:call setreg('"', @", 'l')
Vim registers carry not just their text content but also a type: charwise (c), linewise (l), or blockwise (b).
"-
Vim silently stores every deletion of less than one line in the special "- register (the "small delete" register).
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
@"
Vim macros are stored in registers — and you can execute any register as a macro with @{register}.
"+p
The "+p command pastes the contents of the system clipboard into Vim.
"Ayy
The "Ayy command appends the current line to register a instead of overwriting it.
"+y
The "+y command yanks (copies) text into the system clipboard register, making it available to paste in other applications outside of Vim.
:DB
The vim-dadbod plugin by Tim Pope turns Vim into a powerful database client.