How do I paste the unnamed register after transforming it to uppercase?
Registers in Vim are not only for raw replay; you can treat them as string data and transform them at paste time.
category:
registers
tags:
#registers
#expression-register
#editing
#vimscript
How do I paste multiline clipboard text as a comma-separated list in Insert mode?
<C-r>=substitute(getreg('+'), '\n\+', ', ', 'g')<CR>
When you paste from the system clipboard into code or config, multiline text often needs to be flattened first.
category:
registers
tags:
#registers
#insert-mode
#expression-register
#text-processing
How do I insert a register in Insert mode without reindenting each inserted line?
When you paste multiline snippets from a register while in Insert mode, default insertion can trigger indentation and formatting side effects line by line.
category:
registers
tags:
#registers
#insert-mode
#formatting
#indentation
#editing
How do I search literally for the exact text I yanked last?
:let @/ = '\V' . escape(@0, '\')
When the text you yank contains regex characters, a normal / search can produce noisy or surprising matches.
category:
registers
tags:
#registers
#search
#regex
#command-line
How do I insert a timestamp computed by Vimscript directly from Normal mode?
"=strftime('%Y-%m-%d %H:%M')<CR>p
The expression register lets you evaluate Vimscript on demand and paste the result immediately.
category:
registers
tags:
#registers
#expression-register
#automation
#timestamps
How do I copy my most recent yank from register 0 into the system clipboard register?
When you yank text in Vim, register 0 always holds the most recent yank, independent of deletes that may have changed the unnamed register.
category:
registers
tags:
#registers
#clipboard
#yank
#workflow
How do I insert the unnamed register literally in Insert mode without auto-indent side effects?
In Insert mode, plain {register} inserts register content but may reindent or auto-format depending on context.
category:
registers
tags:
#registers
#insert-mode
#editing
#indentation
#text
How do I remove the last recorded keystroke from a register or macro in Vim?
Macros and named registers are just strings, so you can surgically edit them instead of re-recording from scratch.
category:
registers
tags:
#registers
#macros
#vimscript
#editing
How do I evaluate a Vim expression and paste the result directly from a register?
The expression register lets you compute text on demand and insert it without leaving Normal mode workflows.
category:
registers
tags:
#registers
#expression-register
#normal-mode
#automation
How do I append multiple yanks into one named register and paste them as one block?
Named registers are much more powerful when you treat them as accumulators instead of one-shot clipboards.
category:
registers
tags:
#registers
#named-registers
#yank
#paste
How do I force a register to be linewise before I put it in Vim?
:call setreg('a', @a, 'V')
When you paste from a register, Vim uses that register's stored type: characterwise, linewise, or blockwise.
category:
registers
tags:
#registers
#editing
#command-line
#setreg
How do I append the current filename to a named register from Ex command-line?
:let @a .= expand('%:t') . "\n"
Named registers are not just for yanks and deletes.
category:
registers
tags:
#registers
#command-line
#automation
#editing
How do I preview a macro register with escaped keycodes before executing it?
Macro failures are often caused by hidden control keys like , , or tabs that are hard to see in raw register output.
category:
registers
tags:
#registers
#macros
#debugging
#command-line
How do I replace the next word with a yanked word without clobbering the unnamed register?
When you are doing repetitive refactors, cw is fast but it overwrites the unnamed register with the replaced text.
category:
registers
tags:
#registers
#editing
#normal-mode
#insert-mode
How do I inspect a register as a list of lines in Vimscript?
For advanced register debugging and macro tooling, plain getreg('a') is often not enough.
category:
registers
tags:
#registers
#vimscript
#debugging
#automation
How do I copy a register to another register while preserving its character/line/block type?
:call setreg('q', getreg('a'), getregtype('a'))
Simple register copies can silently change behavior when register type is lost.
category:
registers
tags:
#registers
#macros
#command-line
#editing
How do I copy a named register into the system clipboard without yanking again?
If you already have carefully collected text in a named register, re-yanking just to reach the system clipboard is noisy and error-prone.
category:
registers
tags:
#registers
#clipboard
#command-line
#workflow
How do I copy one register to another while preserving its exact register type?
:call setreg('b', getreg('a'), getregtype('a'))
Plain register copies like :let @b = @a move text, but they can lose important metadata about register type.
category:
registers
tags:
#registers
#advanced
#vimscript
#editing
How do I store the current file path in a named Vim register?
Named registers are not only for yanked text.
category:
registers
tags:
#registers
#command-line
#filename-modifiers
#editing
How do I programmatically create a blockwise register with setreg()?
:call setreg('a', "foo\nbar", 'b')
Most register examples focus on interactive yanks, but setreg() lets you construct registers programmatically, including their type.
category:
registers
tags:
#registers
#vimscript
#automation
#editing