Created
January 3, 2012 11:46
-
-
Save alesya-h/1554613 to your computer and use it in GitHub Desktop.
type jk in insert mode to switch to normal mode (for emacs-evil)
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
(defun evil-insert-jk-for-normal-mode () | |
(interactive) | |
(insert "j") | |
(let ((event (read-event nil))) | |
(if (= event ?k) | |
(progn | |
(backward-delete-char 1) | |
(evil-normal-state)) | |
(push event unread-command-events)))) | |
(define-key evil-insert-state-map "j" 'evil-insert-jk-for-normal-mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works, but we can not insert
jk
literally anymore, which is not satisfactory.