From 746cefd4d674bfc6dd9fdfe4aeb79c7e760ec268 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 25 Oct 2025 19:56:40 -0500 Subject: refactor:keymaps: Replace define-prefix-command with defvar-keymap Refactor the keymap definitions across multiple modules by replacing `define-prefix-command` with `defvar-keymap`. This simplifies the keymap setup and integrates better with the `which-key` package for enhanced documentation and usability. Updated modules include custom-ordering, custom-text-enclose, custom-whitespace, mail-config, music-config, org-drill-config, test-runner, and vc-config. --- modules/vc-config.el | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'modules/vc-config.el') diff --git a/modules/vc-config.el b/modules/vc-config.el index 56ba1944..3b116cc1 100644 --- a/modules/vc-config.el +++ b/modules/vc-config.el @@ -118,17 +118,20 @@ ;; --------------------------------- VC Keymap --------------------------------- ;; Ordering & sorting prefix and keymap -(define-prefix-command 'cj/vc-map nil - "Keymap for version control operations.") -(keymap-set cj/custom-keymap "v" #'cj/vc-map) -(keymap-set cj/vc-map "d" #'cj/goto-git-gutter-diff-hunks) -(keymap-set cj/vc-map "c" #'cj/forge-create-issue) -(keymap-set cj/vc-map "f" #'forge-pull) -(keymap-set cj/vc-map "i" #'forge-list-issues) -(keymap-set cj/vc-map "n" #'git-gutter:next-hunk) -(keymap-set cj/vc-map "p" #'git-gutter:previous-hunk) -(keymap-set cj/vc-map "r" #'forge-list-pullreqs) -(keymap-set cj/vc-map "t" #'cj/git-timemachine) +(defvar-keymap cj/vc-map + :doc "Keymap for version control operations" + "d" #'cj/goto-git-gutter-diff-hunks + "c" #'cj/forge-create-issue + "f" #'forge-pull + "i" #'forge-list-issues + "n" #'git-gutter:next-hunk + "p" #'git-gutter:previous-hunk + "r" #'forge-list-pullreqs + "t" #'cj/git-timemachine) + +(keymap-set cj/custom-keymap "v" cj/vc-map) +(with-eval-after-load 'which-key + (which-key-add-key-based-replacements "C-; v" "version control menu")) (provide 'vc-config) ;;; vc-config.el ends here. -- cgit v1.2.3