added automatic switch evil-normal-state when entering evil-motion-state

This commit is contained in:
syl20bnr 2013-01-05 15:27:19 -05:00
parent 62fe802aa4
commit a632addab8

View file

@ -24,3 +24,10 @@
(add-hook 'evil-emacs-state-entry-hook
(lambda ()
(add-hook 'post-command-hook 'evil-emacs-state-2-evil-normal-state)))
;; same thing for motion state
(defun evil-motion-state-2-evil-normal-state ()
(evil-normal-state)
(remove-hook 'post-command-hook 'evil-motion-state-2-evil-normal-state))
(add-hook 'evil-motion-state-entry-hook
(lambda ()
(add-hook 'post-command-hook 'evil-motion-state-2-evil-normal-state)))