This post described how to do it in Vim, where one prefixes their copy command with "
+ <register name>
(ie k
). How can I do this in Emacs Evil-Mode?
For example, I tried the following:
yy
- copy first line to clipboardjjj
- move to some new line"kyy
- copy second line to register k
p
- paste first line"kp
- paste second lineHowever, at p
, Emacs pastes my second line, as if the register was ignored and copied directly to the clipboard. Any suggestions on how to use Vim-like registers? If not, any suggestions on how to copy and paste multiple regions in Evil-Mode?
I think setting this value will do it:
(setq x-select-enable-clipboard nil)
Using evil (in spacemacs), "+y
still copies to clipboard, so I think that should work.
If not, this blog post describes a more verbose method: Write handlers for all ways you can delete to avoid touching the clipboard and rebind keys to use these handlers.
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