How do I change whether a register pastes as character, line, or block-wise?
:call setreg('"', @", 'l')
Vim registers carry not just their text content but also a type: charwise (c), linewise (l), or blockwise (b).
: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.
/<C-r>a
While in the search prompt (/), press a to insert the contents of register a.
"a]p
Use ]p after specifying a register to paste with adjusted indentation.
<C-r>a
In insert mode, press followed by the register name.
"0p in visual mode
When you paste over a visual selection with p, Vim replaces the selection with the register contents — but it also puts the deleted selection into the unnamed
"-p
The small delete register ("-) captures text from delete operations that are less than one line — like dw, x, dt.
"0p
Register 0 (the yank register) always contains the text from your most recent yank command — and unlike the unnamed register, it is never overwritten by delet
<C-r><C-o>"
The {register} sequence in insert mode pastes register contents literally — without triggering auto-indentation, abbreviations, or mappings.