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

How do you assign text to a register using :let?

Answer

:let @a = 'hello world'

Explanation

Use :let @a = 'text' to set register a to any string. Supports escape sequences and expressions. Useful for scripting.

Next

How do I visually select a double-quoted string including the quotes themselves?