How can i yank to/from windows clipboard when using:
- Windows 7 (x64)
- GNU Emacs 24.4.1 (x64)
- Evil 1.0.9
- and having
(setq x-select-enable-clipboard nil)
in my.emacs
? (I put this line there because i didn't want vim changes (x, d, etc) to clobber my os clipboard.
I tried "+p, "*p, "+y, "*y, CTRL+Y but it doesn't work. When i run :registers
it doesn't even show +
or *
registers.
To clarify: I want Emacs to behave like Vim when copying/yanking to/from different registers, without clobbering os clipboard with every text changing command. In particular:
- yy - should NOT yank text to os clipboard (only to
0
register) - "+yy - should yank text to os clipboard
- dd - should NOT clobber os clipboard
- cw - shold NOT clobber os clipboard
- etc.
(setq x-select-enable-clipboard nil)
is enough too because there are+
and*
registers to work with os clipboard, not under windows unfortunately. – Kossak Jun 26 '15 at 17:37(setq x-select-enable-clipboard nil)
: The yanking FROM os clipboard works as it should, but i can't yank the selection TO os clipboard (with bindings(define-key evil-normal-state-map (kbd "C-y") 'paste-from-clipboard)
and(define-key evil-visual-state-map (kbd "C-y") 'paste-from-clipboard)
– Kossak Jun 26 '15 at 17:39paste-from-clipboard
will only paste from clipboard. You'll need another function to copy to clipboard. I edited the question to added acopy-to-clipboard
function. Please try if it works – Jesse Jun 26 '15 at 18:30yank
function copies to and from os clipboard (based on the presence of visual selection). Your other function does what i want, thank you. – Kossak Jun 27 '15 at 08:20