I would like to make a shortcut to append to the register "+" (so I can do a system paste outside of Vim). For example, I would like to do "+yy to copy one line, and then "=yy to append another line to the '+' register.
I've found VIM: how to append yanked text to unnamed register and I feel like it should be easy to get what I want, but I don't understand anything of Vim script.
You could choose an arbitrary register, say z, to which you do the appending dance, "zyy then "Zyy, and create a shortcut just for "exporting" that register:
nnoremap <silent> <key> :<C-u>call setreg('+', getreg('z', 1), getregtype('z'))<CR>
(Edited as per ZyX's comment.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With