From 02cd35da6e6403946ae021f0abf6d4e800d1e8c8 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 21 Dec 2020 22:53:27 -0600 Subject: Add keybindings --- config.org | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'config.org') diff --git a/config.org b/config.org index f41c24b..5af41cb 100644 --- a/config.org +++ b/config.org @@ -628,6 +628,49 @@ This is not /quite/ correct yet. For example, scrolling in the margins with a t (bind-key vec #'mwheel-scroll)) #+end_src +** Keyboard + +*** Use =ESC= as a cancel key + +From [[https://github.com/link0ff/emacs-init][link0ff]]. I thought they made a great point that =ESC= isn’t necessary to copy the =META= key on window-systems, which is where I use Emacs, anyway. + +#+begin_src emacs-lisp + (when window-system + (define-key global-map [escape] 'keyboard-escape-quit) + (define-key isearch-mode-map [escape] 'isearch-cancel)) +#+end_src + +*** Make =C-z= more useful as a prefix key + +Also from link0ff. See the above for a link. + +#+begin_src emacs-lisp + (defvar my-map + (let ((map (make-sparse-keymap)) + (c-z (global-key-binding "\C-z"))) + (global-unset-key "\C-z") + (define-key global-map "\C-z" map) + (define-key map "\C-z" c-z) + map)) + (run-hooks 'my-map-defined-hook) +#+end_src + +*** Which-key + +#+begin_src emacs-lisp + (use-package which-key + :config + (which-key-mode +1)) +#+end_src + +*** Bindings + +**** Switch to another window + +#+begin_src emacs-lisp + (bind-key "M-o" #'other-window) +#+end_src + * Persistence ** Save history -- cgit 1.4.1-21-gabe81