summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-10-23 00:05:08 -0500
committerCraig Jennings <c@cjennings.net>2025-10-23 00:05:08 -0500
commitd946e5f76047ab060ca3e30f513d12bb5e64facd (patch)
tree7bb286d9385b35a102e8bb68902ea8ed202de5db
parent6810e57519779b650c7129bdea7d2a95fbec819a (diff)
refactor:help-utils: keymap bindings for devdocs and cj/local-arch
Replace `global-set-key` with `keymap-global-set` for consistency and improved readability. Additionally, transition devdocs commands from deferred loading to command-based setup, enhancing initialization control.
-rw-r--r--modules/help-utils.el23
1 files changed, 11 insertions, 12 deletions
diff --git a/modules/help-utils.el b/modules/help-utils.el
index dcb7a748..91ac8947 100644
--- a/modules/help-utils.el
+++ b/modules/help-utils.el
@@ -26,27 +26,26 @@
;; ---------------------------------- Devdocs ----------------------------------
(use-package devdocs
- :defer 1
+ :commands (devdocs-search devdocs-peruse devdocs-lookup devdocs-install devdocs-delete devdocs-update-all)
+ :init
+ (keymap-global-set "C-h D s" #'devdocs-search)
+ (keymap-global-set "C-h D b" #'devdocs-peruse)
+ (keymap-global-set "C-h D l" #'devdocs-lookup)
+ (keymap-global-set "C-h D i" #'devdocs-install)
+ (keymap-global-set "C-h D d" #'devdocs-delete)
+ (keymap-global-set "C-h D u" #'devdocs-update-all)
:config
- (global-set-key (kbd "C-h D s") 'devdocs-search)
- (global-set-key (kbd "C-h D b") 'devdocs-peruse)
- (global-set-key (kbd "C-h D l") 'devdocs-lookup)
- (global-set-key (kbd "C-h D i") 'devdocs-install)
- (global-set-key (kbd "C-h D d") 'devdocs-delete)
- (global-set-key (kbd "C-h D u") 'devdocs-update-all)
- (define-key devdocs-mode-map "b" 'devdocs-go-back)
- (define-key devdocs-mode-map "f" 'devdocs-go-forward))
+ (define-key devdocs-mode-map "b" #'devdocs-go-back)
+ (define-key devdocs-mode-map "f" #'devdocs-go-forward))
;; ------------------------------------ TLDR -----------------------------------
(use-package tldr
- :defer 1
:bind ("C-h T" . tldr))
;; -------------------------------- Wiki Summary -------------------------------
(use-package wiki-summary
- :defer 1
:bind ("C-h W" . wiki-summary))
;; --------------------------- Browse Local Arch Wiki --------------------------
@@ -71,7 +70,7 @@ arch-wiki-docs."
(url (concat "file://" fullname)))
(eww-browse-url url))
(message "File not found! Is arch-wiki-docs installed?"))))
-(global-set-key (kbd "C-h A") 'cj/local-arch-wiki-search)
+(keymap-global-set "C-h A" #'cj/local-arch-wiki-search)
(provide 'help-utils)
;;; help-utils.el ends here