diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-05-26 21:20:41 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-05-31 15:17:31 -0700 |
commit | bffb93dfbd5075796223032dff14f5ef7b2feeb7 (patch) | |
tree | 87fbf32ce68992e7837b8ea2c60fc2d375b76721 /.emacs.d | |
parent | 77ace2073fd5e6bc9d419d0d9c92225f7c1feb7f (diff) | |
download | dotfiles-bffb93dfbd5075796223032dff14f5ef7b2feeb7.tar.gz |
replace key-chord.el usage with new global bindings
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/init-spw.el | 66 |
1 files changed, 24 insertions, 42 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el index 724065db..4ae609bc 100644 --- a/.emacs.d/init-spw.el +++ b/.emacs.d/init-spw.el @@ -900,49 +900,31 @@ Passes ARG to `projectile-switch-project-by-name'." (use-package haskell-tab-indent :if (spw--optional-pkg-available-p "haskell-tab-indent")) -;; key chords +;; In an effort to reduce chording with the control key, provide +;; alternative access to the C-c and C-x keymaps. Use right alt for +;; M-r, left alt for M-=. +;; +;; Best for entering commands where the key after C-c/C-x is not +;; modified by control. Otherwise best to just keep control held down +;; and type both modified keys. +(defun spw/access-ctl-c-bindings () + "Access bindings under C-c." + (interactive) + (setq unread-command-events (cons '(t . ?\C-c) unread-command-events))) +(global-set-key "\M-r" 'spw/access-ctl-c-bindings) +(defun spw/access-ctl-x-bindings () + "Access bindings under C-x." + (interactive) + (setq unread-command-events (cons '(t . ?\C-x) unread-command-events))) +(global-set-key "\M-=" 'spw/access-ctl-x-bindings) -(use-package key-chord - :config - (key-chord-mode 1) - ;; Access the C-c and C-x keymaps with comfortable key chords. Best - ;; for entering commands where the key after C-c/C-x is not modified - ;; by control. Otherwise best to just keep control held down and - ;; type both modified keys - (key-chord-define-global "jk" (lambda () - (interactive) - (setq unread-command-events - (cons '(t . ?\C-c) - unread-command-events)))) - (key-chord-define-global ",." (lambda () - (interactive) - (setq unread-command-events - (cons '(t . ?\C-x) - unread-command-events))))) - -;; good key chords from -;; <http://www.johndcook.com/blog/2015/02/01/rare-bigrams/> via -;; <https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-key-chord.el> - -;; BF BG BQ BX BZ -;; CJ CV -;; DX DZ -;; FB FJ FQ FV FZ -;; GB GJ GP GQ GV GX GZ -;; HJ HQ HV -;; JJ JC JF JG JH JK JL JM JP JQ JS JT JV JW JX JY JZ -;; KK KJ KQ KV KX KZ -;; LJ LQ -;; MJ MQ MV MX MZ -;; PG PJ PQ PV PZ -;; QQ QB QF QG QH QJ QK QL QM QP QT QV QW QX QY QZ -;; SJ SX SZ -;; TJ TQ -;; VV VC VF VG VH VJ VK VM VP VQ VW VZ -;; WW WJ WQ WV WX WZ -;; XB XD XG XJ XK XM XQ XS XW XZ -;; YY YJ YQ -;; ZB ZD ZF ZG ZJ ZK ZM ZP ZQ ZS ZV ZW ZX +;; ... and resettle the former occupant of M-= (isearch replaces +;; `move-to-window-line-top-bottom', so we can help ourselves to M-r) +(global-set-key "\C-cw" 'count-words-region) + +;; ... and reclaim the keys from some major mode maps +(with-eval-after-load 'notmuch-show + (define-key notmuch-show-mode-map "\M-=" nil)) ;;; jump back and forth to and from Emacs lisp definitions with ;;; M-. and M-, and C-c C-d [C-]d to describe |