Created
December 5, 2014 15:36
-
-
Save bjarkevad/416f7af87964db5ab789 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
(defun minibuffer-keyboard-quit () | |
"Abort recursive edit. | |
In Delete Selection mode, if the mark is active, just deactivate it; | |
then it takes a second \\[keyboard-quit] to abort the minibuffer." | |
(interactive) | |
(if (and delete-selection-mode transient-mark-mode mark-active) | |
(setq deactivate-mark t) | |
(when (get-buffer "*Completions*") (delete-windows-on "*Completions*")) | |
(abort-recursive-edit))) | |
(define-key evil-normal-state-map [escape] 'keyboard-quit) | |
(define-key evil-visual-state-map [escape] 'keyboard-quit) | |
(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit) | |
(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit) | |
(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit) | |
(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit) | |
(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit) | |
(global-set-key [escape] 'evil-exit-emacs-state) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment