Created
April 19, 2013 14:20
-
-
Save txus/5420665 to your computer and use it in GitHub Desktop.
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
(setq evil-want-C-u-scroll t) ; Ctrl-u to scroll up | |
;; evil | |
(live-load-config-file "evil-conf.el") | |
;; evil-leader | |
(live-load-config-file "evil-leader-conf.el") | |
;; evil-surround | |
(live-load-config-file "evil-surround-conf.el") | |
;; evil-nerd-commenter | |
(live-load-config-file "evil-nerd-commenter-conf.el") | |
; map jk to ESC | |
(define-key evil-insert-state-map "j" #'cofi/maybe-exit) | |
(evil-define-command cofi/maybe-exit () | |
:repeat change | |
(interactive) | |
(let ((modified (buffer-modified-p))) | |
(insert "j") | |
(let ((evt (read-event (format "Insert %c to exit insert state" ?k) | |
nil 0.5))) | |
(cond | |
((null evt) (message "")) | |
((and (integerp evt) (char-equal evt ?k)) | |
(delete-char -1) | |
(set-buffer-modified-p modified) | |
(push 'escape unread-command-events)) | |
(t (setq unread-command-events (append unread-command-events | |
(list evt)))))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment