Note: all of the following information (and much more) can be found using :help @
, :help "
, :help let-@
, and :help expr-register
"ap
,"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 @
and "
are occasionally interchangeable:
""p
, "@p
, p
: put from register "
, this is called the "unnamed register," but in fact it has at least two names, "
and @
.
@"
: replay the contents of register "
as a normal command (this is rarely done).
@@
: replay the previously used @{reg}
.
Then, there are the let
and expression usages:
:let @" = 'string'
: let @@ = 'string'
: assign a string to register "
.
:echo @@
, :echo @"
: echo the value of register "
:echo @
: also echo the value of register "
.
:echo "@
, :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 :@{reg}
.