Note: all of the following information (and much more) can be found using
:help let-@, and
"ad, &c.: use register
a in a put from or delete to.
@a: replay the contents of register
a as a sequence of normal commands
:let @a = 'string': assign a string to register a.
Now, there is likely some confusion because
" are occasionally interchangeable:
p: put from register
", this is called the "unnamed register," but in fact it has at least two names,
@": replay the contents of register
" as a normal command (this is rarely done).
@@: replay the previously used
Then, there are the
let and expression usages:
:let @" = 'string':
let @@ = 'string': assign a string to register
:echo @": echo the value of register
:echo @: also echo the value of register
:echo ": syntax error.
Finally, you can execute registers as an ex command (i.e., cmdline mode),
:@a: execute contents of register
a as an ex command.
:@:: execute the previous command line
:@@: execute the previous