Skip to content

Instantly share code, notes, and snippets.

@deech
Last active August 29, 2015 14:19
Show Gist options
  • Save deech/3ac0e100065eb024b29e to your computer and use it in GitHub Desktop.
Save deech/3ac0e100065eb024b29e to your computer and use it in GitHub Desktop.
;; Neat way of getting all Emacs functionality in Evil's insert mode
(defun with-evil-mode (mode key-behavior-pairs)
(mapcar #'(lambda (pair)
(define-key
mode
(car pair)
(cdr pair)))
key-behavior-pairs))
(setcdr evil-insert-state-map nil)
(with-evil-mode evil-insert-state-map
'(
([(control f10)] . evil-paste-from-register)
([(control f11)] . evil-copy-from-above)
([(control f12)] . evil-copy-from-below)
([escape] . evil-normal-state)))
;; If you want this in Spacemacs just insert the above
;; into your .spacemacs file here:
;; (defun dotspacemacs/config ()
;; ...
;; (setcdr evil-insert-state-map nil)
;; (with-evil-mode evil-insert-state-map
;; '(
;; ([(control f10)] . evil-paste-from-register)
;; ([(control f11)] . evil-copy-from-above)
;; ([(control f12)] . evil-copy-from-below)
;; ([escape] . evil-normal-state)))
;; ...
;; )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment