Answer
"=strftime('%F')<CR>p
Explanation
The expression register lets you compute text on demand and insert it without leaving Normal mode workflows. "=strftime('%F')<CR>p evaluates a Vim expression, stores the result in the expression register, then puts it into the buffer. This is useful when you need dynamic values such as timestamps, arithmetic results, or transformed strings while staying inside an operator/motion rhythm.
How it works
"=opens the expression register promptstrftime('%F')is the Vim expression being evaluated (YYYY-MM-DD)<CR>confirms and stores the evaluated resultpputs that result after the cursor
Example
Given this line with the cursor on DATE::
Release DATE:
Type:
"=strftime('%F')<CR>pResult:
Release DATE: 2026-03-27
Tips
- Replace
strftime('%F')with any Vim expression, for exampletoupper('abc')orline('.') - The same expression-register idea also works in Insert mode and command-line mode when you need computed text inline
category: registers tags: #registers #expression-register #normal-mode #automation
Next
How do I debug a Vim macro one command at a time?
Related Tricks
How do I paste the unnamed register after transforming it to uppercase?
:put =toupper(@")
How do I paste multiline clipboard text as a comma-separated list in Insert mode?
<C-r>=substitute(getreg('+'), '\n\+', ', ', 'g')<CR>
How do I insert a register in Insert mode without reindenting each inserted line?
<C-r><C-o>a
How do I search literally for the exact text I yanked last?
:let @/ = '\V' . escape(@0, '\')
How do I insert a timestamp computed by Vimscript directly from Normal mode?
"=strftime('%Y-%m-%d %H:%M')<CR>p
