This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; evil-emacs-state is annoying, the following function and hook automatically | |
;; switch back to evil-normal-state whenever the evil-emacs-state is entered. | |
;; It allows a more consistent navigation experience among all mode maps. | |
;; To enter special commands of custom mode maps, just enter the insert mode :-) | |
(defun evil-emacs-state-2-evil-normal-state () | |
(evil-normal-state) | |
(remove-hook 'post-command-hook 'evil-emacs-state-2-evil-normal-state)) | |
(add-hook 'evil-emacs-state-entry-hook | |
(lambda () | |
(add-hook 'post-command-hook 'evil-emacs-state-2-evil-normal-state))) |