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 insert the result of a Vim expression or calculation directly into text?
The expression register ("=) lets you evaluate any Vim expression and insert its result as text.
category:
registers
tags:
#registers
#insert-mode
#editing
#ex-commands
How do I always access my last yanked text regardless of deletes?
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
category:
registers
tags:
#registers
#paste
#yank
#workflow
How do I add more steps to an existing macro without re-recording it from scratch?
When you record a macro into register q with qq.
category:
macros
tags:
#macros
#registers
#recording
#editing
How to configure what Neovim saves between sessions using the ShaDa file?
Neovim's ShaDa (Shared Data) file replaces Vim's viminfo and persists session state across restarts — marks, registers, command history, search history, jump
category:
config
tags:
#config
#navigation
#registers
#ex-commands
How do I programmatically manipulate register contents using setreg and getreg?
:call setreg('a', @a . 'text', 'l')
How it works Vim provides two functions for advanced register manipulation: setreg() and getreg().
category:
registers
tags:
#registers
#ex-commands
#editing
How do I refactor a recorded macro by rewriting its keystrokes with substitute()?
:let @q = substitute(@q, 'foo', 'bar', 'g')
Recorded macros are plain text stored in registers, which means you can refactor them instead of re-recording from scratch.
category:
macros
tags:
#macros
#registers
#automation
#ex-commands
How do I add more keystrokes to the end of an existing macro without re-recording the whole thing?
qQ (or any uppercase register letter)
When recording a macro with qq, you can append additional keystrokes to the existing macro by recording into the uppercase version of the same register.
category:
macros
tags:
#macros
#registers
#normal-mode
How do I append text to a named register programmatically without re-recording a macro?
Vim registers are just strings, and you can read and write them directly using the :let command.
category:
registers
tags:
#registers
#vimscript
#macros
#editing
How do I use the expression register in a mapping to insert dynamic values?
:nnoremap <leader>d "=strftime('%Y-%m-%d')<CR>p
The expression register (=) evaluates Vimscript expressions and uses the result as register content.
category:
registers
tags:
#registers
#expression
#mapping
#dynamic
How do I append text to a register instead of replacing it?
The "Ayy command appends the current line to register a instead of overwriting it.
category:
registers
tags:
#registers
#yank
#editing
#normal-mode
How do I append more commands to a recorded macro without re-recording it?
When a recorded macro is almost right but missing one repeated step, re-recording from scratch is usually slower and riskier than patching the register directly
category:
macros
tags:
#macros
#registers
#command-line
#normal-mode
How do I insert register contents into the command line?
How it works While typing an Ex command on the command line (after pressing :), you can insert the contents of any register by pressing Ctrl-R followed by the r
category:
registers
tags:
#registers
#ex-commands
#editing
How do I paste text above the current line?
The P (uppercase) command pastes the contents of the default register before the cursor position.
category:
editing
tags:
#editing
#registers
#normal-mode
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 define or modify a macro directly as a string without recording it?
Macros in Vim are stored in registers as plain text.
category:
macros
tags:
#macros
#registers
#ex-commands
#normal-mode
How do I inspect a Vim register's full details including its type (charwise, linewise, or blockwise) in Vimscript?
getreginfo('{reg}') (Vim 8.
category:
registers
tags:
#registers
#normal-mode
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 programmatically set a register's content or pre-load a macro using setreg()?
The setreg() VimScript function lets you populate any register with arbitrary content directly from the command line or a script — no recording required.
category:
registers
tags:
#registers
#macros
#vimscript
#normal-mode
How do I save a recorded macro permanently so it survives Vim restarts?
Macros recorded with q{register} are stored in registers and lost when Vim exits.
category:
macros
tags:
#macros
#registers
#config