Issue #304 wontfix
Paste/Yank to Clipboard: Best Practices
(defun haroogan/evil-paste-from-clipboard () "Paste text from system clipboard." (interactive) (evil-paste-from-register ?+)) (evil-define-operator haroogan/evil-yank-to-clipboard (beg end type yank-handler) "Yank text to system clipboard." :move-point nil :repeat nil (interactive "<x><y>") (evil-yank beg end type ?+ yank-handler))
Paste works as intended. Yank works partly:
- after yanking I can paste this text into other applications;
- but I cannot paste it into the Emacs itself, i.e. by using
haroogan/evil-paste-from-clipboard- it says that the
kill-ringis empty; how come?
For the reference, in my
.vimrc I have the following:
" Cut to the system clipboard. nnoremap <C-x> "+x vnoremap <C-x> "+x cnoremap <C-x> "+x " Yank to the system clipboard. nnoremap <C-y> "+y vnoremap <C-y> "+y cnoremap <C-y> "+y " Paste from the system clipboard. nnoremap <C-p> "+p vnoremap <C-p> "+p cnoremap <C-p> "+p
What's the best way to replicate this with Evil?