vimtricks.wiki Concise Vim tricks, one at a time.

How do you record a macro that inserts a date stamp?

Answer

qaA <C-r>=strftime('%Y-%m-%d')\n<Esc>jq

Explanation

Record a macro that appends a date stamp using the expression register with strftime(). Moves to the next line for batch processing.

Next

How do you yank a single word into a named register?