How do I append multiple yanks into one named register and paste them as one block?
"ayyj"Ayyk"ap
Named registers are much more powerful when you treat them as accumulators instead of one-shot clipboards.
"ayyj"Ayyk"ap
Named registers are much more powerful when you treat them as accumulators instead of one-shot clipboards.
<C-r><C-o>
When you paste a register in insert mode with {reg}, Vim inserts the text as if you had typed it — which means auto-indent, abbreviation expansion, and other
registers #registers #insert-mode #paste #autoindent #editing
gP
The gP command works like P (paste before the cursor) but leaves your cursor after the pasted text rather than at its beginning.
:put {reg}
The :put Ex command always inserts a register's content as a new line below the current line, regardless of whether the register holds characterwise, linewise,
editing #registers #editing #paste #ex-commands #normal-mode
:set pastetoggle=<F2>
The pastetoggle option assigns a single key to toggle Vim's paste mode on and off without typing :set paste or :set nopaste every time.
zp
Pastes a blockwise register like p, but skips padding lines shorter than the block's right edge with trailing spaces.
{visual}p
When you visually select text and press p, Vim replaces the selection with the contents of the default register and saves the replaced text into the unnamed reg
:call setreg('"', @", 'l')
Vim registers carry not just their text content but also a type: charwise (c), linewise (l), or blockwise (b).
P (in visual mode)
When you paste over a visual selection using p (lowercase), Vim replaces the selection with your register contents — but the replaced text overwrites your unn
<C-r><C-r>{register}
In insert mode, {reg} pastes from a register but treats certain bytes as key inputs — so a register containing \n triggers a newline, \x08 triggers backspace,
gp
The standard p command pastes text after the cursor but leaves the cursor at the beginning of the pasted text.
"1p then u then . to cycle
Vim stores your last 9 deletions in numbered registers "1 through "9.
<C-r><C-r>a
In insert mode, a pastes register a but processes the text as if typed, which can trigger abbreviations and mappings.
"_dP in visual mode
Use "_dP which deletes the selection into the black hole register and pastes before.
qa"bpq
While recording macro a, paste from register b with "bp.
"_dP or use "0p
When pasting over a selection, the replaced text overwrites the unnamed register.
"ap
In visual mode, "ap replaces the selected text with the contents of register a.
5"ap
Prefix the paste command with a count.
"aP
Use "aP (uppercase P) to paste the contents of register a before the cursor position, as opposed to "ap which pastes after.
:call setreg('a', @a, 'v') then "ap
Use setreg() to change register a to characterwise mode (v), then paste.