diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-12 12:21:18 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-12 12:21:18 -0500 |
| commit | 5db41b5a2dc7107f2d3bd2c226e1dbc3a91719e8 (patch) | |
| tree | 6a6cc010b076ea68c8b9c7898a8de462e978b151 /modules/keybindings.el | |
| parent | 6977f5424c638dc2ee930020ef746f52f3b3a5db (diff) | |
refactor: keybindings: Consolidate custom keymap setup
Unbind Flyspell's 'C-;' keybinding.
Move the custom-keymap definition to keybindings.el bound 'C-;'
Diffstat (limited to 'modules/keybindings.el')
| -rw-r--r-- | modules/keybindings.el | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/modules/keybindings.el b/modules/keybindings.el index 3d817013..d7af0bb2 100644 --- a/modules/keybindings.el +++ b/modules/keybindings.el @@ -3,8 +3,6 @@ ;;; Commentary: - - ;; Commonly used files should be easy to jump to. The "jump-to" keymap has the ;; "C-c j" prefix and immediately opens files defined in user-constants.el. @@ -24,6 +22,28 @@ ;; remap Shift Backspace to Delete (global-set-key (kbd "S-<backspace>") 'delete-forward-char) +;; ------------------------------- Custom Keymap ------------------------------- + +(defvar cj/custom-keymap + (let ((map (make-sparse-keymap))) + map) + "The base key map for custom elisp functions holding miscellaneous functions. +Other key maps extend from this key map to hold categorized functions.") + +;; Set the global binding +(global-set-key (kbd "C-;") cj/custom-keymap) + +;; Override flyspell's binding when it loads +(with-eval-after-load 'flyspell + (define-key flyspell-mode-map (kbd "C-;") nil)) + +;; Unnecessary, but leaving here for reference. +;; Optional: Ensure it stays unbound even if flyspell redefines it +;; (add-hook 'flyspell-mode-hook +;; (lambda () +;; (define-key flyspell-mode-map (kbd "C-;") nil))) + + ;; ------------------------------ Jump To Commands ----------------------------- ;; quick access for commonly used files @@ -50,7 +70,6 @@ (define-key jump-to-keymap (kbd "I") #'(lambda () (interactive) (find-file emacs-init-file))) - ;; ---------------------------- Keybinding Discovery --------------------------- (use-package free-keys @@ -95,6 +114,5 @@ (message (concat "Seriously, " user-name "? Use 'C-/'. It's faster.")))) - (provide 'keybindings) ;;; keybindings.el ends here |
