How do I preserve the last full-line deletion before register 1 is overwritten?
:let @a=@1
When you delete full lines repeatedly, Vim rotates those deletions through numbered registers.
61 results for "named register paste"
:let @a=@1
When you delete full lines repeatedly, Vim rotates those deletions through numbered registers.
"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
:help registers
Vim has 10 types of registers, each serving a specific purpose.
gP
The gP command works like P (paste before the cursor) but leaves your cursor after the pasted text rather than at its beginning.
:let @q = substitute(@q, 'old', 'new', '')
Vim macros are stored as plain text in named registers, which means you can inspect and modify them directly using :let and :echo.
:let @a = @"
Vim's :let command lets you read and write register contents as strings, making it possible to copy, combine, or modify register values without ever leaving the
y (in visual mode)
In visual mode, pressing y yanks (copies) the selected text into the default register.
viwp
The viwp command visually selects the word under the cursor and replaces it with the contents of the unnamed register (your last yank or delete).
visual-mode #editing #visual-mode #registers #paste #productivity
:let @a .= getline('.') . "\n"
Named registers are usually filled with yanks and deletes, but they are also plain variables you can edit with Vimscript.
"1p then u.u.u.
Vim stores your last 9 deletions (of one line or more) in the numbered registers "1 through "9.
registers #registers #editing #normal-mode #undo-redo #paste
<C-r><C-r>"
In Insert mode, plain {register} inserts register content but may reindent or auto-format depending on context.
registers #registers #insert-mode #editing #indentation #text
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
:t {address}
How it works The :t command (short for :copy) copies one or more lines and places them below the specified address.
"/
Vim stores the last search pattern in the special / register.
<C-v>jjxp
Visual block mode lets you select, cut, and paste rectangular columns of text.
"qp
Macros are stored as plain text in named registers.
:let @q = @:
The : register always holds the last Ex command you ran.
gp
The standard p command pastes text after the cursor but leaves the cursor at the beginning of the pasted text.
"+q{keys}q
You can record macros into any register, including the system clipboard (+).
:let @a = @a . @b
You can manipulate register contents directly using the :let command with the @{reg} syntax.