How do I search for the contents of a register without typing the pattern manually?
:let @/ = @a
Vim's search register (@/) holds the current search pattern — the same one used by n, N, *, and hlsearch highlighting.
57 results for "named register yank"
:let @/ = @a
Vim's search register (@/) holds the current search pattern — the same one used by n, N, *, and hlsearch highlighting.
"-
Vim silently stores every deletion of less than one line in the special "- register (the "small delete" register).
:call setreg("a", substitute(getreg("a"), "old", "new", "g"))
The getreg() and setreg() functions let you read and write register contents as plain strings, making it possible to surgically edit a macro without re-recordin
qA
If you finish recording a macro and realize you forgot a step, you don't need to re-record the whole thing.
macros #macros #registers #normal-mode #editing #productivity
<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
:let @q = @a . @b
Macros in Vim are stored as plain text in named registers.
"ap, edit, "ayy
Vim stores macros in registers, which means you can paste a macro's contents into a buffer, edit it as regular text, and yank it back into the register.
:reg {name}
The :reg {name} command displays the current contents of one or more named registers in a formatted listing.
:let @a = substitute(@a, 'old', 'new', 'g')
After recording a macro or yanking text into a named register, you may need to tweak it — fix a typo in a recorded macro, change a variable name in yanked tex
:let @+ = @"
Vim's :let @{reg} syntax lets you read from one register and write to another.
:let @a = "value"
The :let @{reg} = expr command lets you assign any string or expression directly into a named register without entering insert mode or performing a yank.
:call setreg('"', @", 'l')
Vim registers carry not just their text content but also a type: charwise (c), linewise (l), or blockwise (b).
:set clipboard=unnamedplus
Setting clipboard=unnamedplus makes Vim's default yank and paste use the system clipboard.
qQ...q
When you record a macro into register q with qq.
:put ={expression}
The :put command inserts the contents of a register as a new line below the cursor.
/\V<C-r><C-r>"
When your yanked text includes regex symbols like .
:let @q .= "keys"
The string concatenation assignment :let @q .