3

I'm starting to think that using the regular C-x C-c C-v keys for kill-ring operations make sense, as they're used that way in every other program I use regularly. (And I'm starting to develop conflicting muscle memories.) However, I use evil-mode. Is there a way to integrate cua-mode (with keys) and evil-insert-state?

  • 1
    I'd recommend to set F2 F3 F4 for that. It's easy to do, and no key conflict, and easier on hand too. But, if you use evil, vi has easy keys for copy/paste, why'd you want the standard shortcut with control? – Xah Lee Jul 9 '16 at 19:21
  • 1
    @XahLee If my goal is compatibility, then F2 and co. do me no favors (although they may be great for other people). While I do use vim style bindings for much of my pasting, I do access and manipulate the kill ring in insert state as well. C-v is faster than ESC p i or even jj p i. Earlier, I had no trouble with C-w and co. but recently I've had to use domain specific editors for my job, and now my muscles are confused. I think consistency may end up being better, although I'm not entirely sure, as I can't test. – PythonNut Jul 10 '16 at 2:40
3

A little bit late to the party but I use the following:

(define-key evil-insert-state-map (kbd "C-c") 'cua-copy-region)
(define-key evil-insert-state-map (kbd "C-v") 'cua-paste)
(define-key evil-insert-state-map (kbd "C-x") 'cua-cut-region)
(define-key evil-insert-state-map (kbd "C-z") 'undo-tree-undo)
(define-key evil-insert-state-map (kbd "C-y") 'undo-tree-redo)

This also includes undo and redo for C-z and C-y and requires the undo-tree package. Keep in mind that if you want to use the usual Emacs shortcuts like C-x C-c to quit Emacs you'll need to leave Insert State first.

  • Ideally, I'd like to do the normal thing where C-x C-c and C-x are disambiguated using timers (or any of the other methods cua-mode uses in a regular Emacs setup). – PythonNut Dec 8 '16 at 1:28
  • I'll look into it – Damian Chrzanowski Dec 8 '16 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.