diff options
author | noa@gaiwan.org | 2024-06-15 17:15:28 +0000 |
---|---|---|
committer | noa@gaiwan.org | 2024-06-15 17:15:28 +0000 |
commit | d18b21e195be7ea84d39ba2689b4490630d24af1 (patch) | |
tree | 91620519ca89f1864242a1d9d60ccc9528d1033e /emacs | |
parent | d5ed3d89eedec76ab2c8dcf9ba16136fbb8824cd (diff) |
Escape always quits
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/init.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el index c5da370..e36a9fd 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -877,6 +877,22 @@ The misspelled word is taken from OVERLAY. WORD is the corrected word." (global-set-key [remap query-replace] 'anzu-query-replace) (global-set-key [remap query-replace-regexp] 'anzu-query-replace-regexp) + +;;; Escape always quits + +;; Due to emacs's legacy running on terminals, some keys are similar but different. By which i mean, we have ESC and escape, TAB and tab, and RET and return. The capital letters refer to the control sequences terminals represent these keys as: C-[, C-i, and C-m respectively. The lower case words refer to the actual keys. + +;; backspace 127 DEL Ctrl+? +;; tab 9 TAB Ctrl+I +;; linefeed 10 LFD Ctrl+J +;; return 13 RET Ctrl+M +;; escape 27 ESC Ctrl+[ + +(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit) +(global-set-key [escape] 'keyboard-quit) +(global-set-key (kbd "C-g") nil) + + ;; Put a quote in the scratch buffer (setopt cookie-file "~/data/quotes") |