VIM: how to append yanked text to unnamed register
- Pick a free register among a-z (I prefer the register a)
- "ay{motion}
- "Ay{motion} ... (to append)
- Now you have all the yanked text in register a.
- And you have the same content in unnamed register as well!
(I happened to find that the unnamed register is synchronized to the named register in such operation.)
The benefit is ... You saves 2 keystrokes to put. ^_^
See h: quote_quote
NB: For operations d, c, s, x, you won't get the same appended text in the unnamed register as in the named register if you are using v7.4. (It's a bug, fixed in v8.0)
You can use this
:let @"=@".getline('.')
to append to the unnamed register. I do not believe there is a keyboard shortcut to do this. (However you could create a mapping if you wanted.)
The reason I say that there is no keyboard shortcut for this is because :h quote_alpha
only talks about uppercase letters (for appending). And there is no equivalent statement in :h quote_quote