From 5db41b5a2dc7107f2d3bd2c226e1dbc3a91719e8 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 12 Oct 2025 12:21:18 -0500 Subject: refactor: keybindings: Consolidate custom keymap setup Unbind Flyspell's 'C-;' keybinding. Move the custom-keymap definition to keybindings.el bound 'C-;' --- modules/custom-functions.el | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'modules/custom-functions.el') diff --git a/modules/custom-functions.el b/modules/custom-functions.el index 61c6e883..e9a05de3 100644 --- a/modules/custom-functions.el +++ b/modules/custom-functions.el @@ -154,26 +154,14 @@ This advice ensures `align-regexp' uses spaces by binding `indent-tabs-mode' to (advice-remove 'align-regexp #'align-regexp-with-spaces) ; in case this is reloaded (advice-add 'align-regexp :around #'cj/align-regexp-with-spaces) -;; Must unbind Flyspell's 'C-;' keybinding before it's assigned to cj/custom-keymap -(global-unset-key (kbd "C-;")) -(eval-after-load "flyspell" - '(define-key flyspell-mode-map (kbd "C-;") nil)) - -(defvar cj/custom-keymap - (let ((map (make-sparse-keymap))) - (define-key map ")" 'cj/jump-to-matching-paren) - (define-key map "f" 'cj/format-region-or-buffer) - (define-key map "W" 'cj/count-words-buffer-or-region) - (define-key map "/" 'cj/replace-fraction-glyphs) - (define-key map "A" 'align-regexp) - (define-key map "B" 'toggle-debug-on-error) - (define-key map "|" 'display-fill-column-indicator-mode) - - ;; load debug helpers only on this keybinding - map) - "The base key map for custom elisp functions holding miscellaneous functions. -Other key maps extend from this key map to hold categorized functions.") -(global-set-key (kbd "C-;") cj/custom-keymap) + +(define-key cj/custom-keymap ")" 'cj/jump-to-matching-paren) +(define-key cj/custom-keymap "f" 'cj/format-region-or-buffer) +(define-key cj/custom-keymap "W" 'cj/count-words-buffer-or-region) +(define-key cj/custom-keymap "/" 'cj/replace-fraction-glyphs) +(define-key cj/custom-keymap "A" 'align-regexp) +(define-key cj/custom-keymap "B" 'toggle-debug-on-error) +(define-key cj/custom-keymap "|" 'display-fill-column-indicator-mode) ;;; ---------------------- Whitespace Operations And Keymap --------------------- -- cgit v1.2.3