From 1a4cd272bf88a617fb0fca8b71ee1c4b13a180fa Mon Sep 17 00:00:00 2001 From: Mike 'Fuzzy' Partin Date: Sat, 6 Jul 2024 10:09:44 -0700 Subject: [PATCH] use that handy thwap/add-key-binding function --- lib/thwap-defaults.el | 13 +++++++------ lib/thwap-lsp.el | 3 +-- lib/thwap-magit.el | 3 +-- lib/thwap-nerdtree.el | 6 ++---- lib/thwap-projectile.el | 3 +-- lib/thwap-yas.el | 3 +-- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/lib/thwap-defaults.el b/lib/thwap-defaults.el index 90bcaeb..c5266f6 100644 --- a/lib/thwap-defaults.el +++ b/lib/thwap-defaults.el @@ -40,16 +40,17 @@ (global-set-key (kbd "C-c t") 'thwap-map) ;; Add a command to customize the T.H.W.A.P. group -(define-key thwap-map (kbd "C-c") (lambda () (interactive) (customize-group 'thwap-config-group))) -(add-to-list 'thwap-help-lines "C-c t C-c : Customize this T.H.W.A.P. Emacs Installation") +(thwap/add-key-binding + "C-c" + (lambda () (interactive) (customize-group 'thwap-config-group)) + "Customize this T.H.W.A.P. Emacs Installation") ;; quick commenting/uncommenting of a region is just too useful -(define-key thwap-map (kbd "c") 'comment-or-uncomment-region) -(add-to-list 'thwap-help-lines "C-c t c : Comment or uncomment region") +(thwap/add-key-binding "c" 'comment-or-uncomment-region "Comment or uncomment region") ;; eval buffer is also very useful -(define-key thwap-map (kbd "e b") 'eval-buffer) -(add-to-list 'thwap-help-lines "C-c t e b : Eval buffer") +(thwap/add-key-binding "e b" 'eval-buffer "Eval buffer") + ;; our provide statement diff --git a/lib/thwap-lsp.el b/lib/thwap-lsp.el index d5029fc..b82eba8 100644 --- a/lib/thwap-lsp.el +++ b/lib/thwap-lsp.el @@ -5,7 +5,6 @@ (straight-use-package 'lsp-treemacs) (setq gc-cons-threshold 100000000) (setq read-process-output-max (* 1024 1024)) - (define-key thwap-map (kbd "l") 'lsp-keymap-prefix) - (add-to-list 'thwap-help-lines "C-c t l : lsp-keymap-prefix")) + (thwap/add-key-binding "l" 'lsp-keymap-prefix "lsp-keymap-prefix")) (provide 'thwap-lsp) diff --git a/lib/thwap-magit.el b/lib/thwap-magit.el index da586f4..409c59d 100644 --- a/lib/thwap-magit.el +++ b/lib/thwap-magit.el @@ -3,7 +3,6 @@ (straight-use-package 'magit) (straight-use-package 'forge) (straight-use-package 'magit-todos) - (define-key thwap-map (kbd "g s") 'magit-status) - (add-to-list 'thwap-help-lines "C-c t g s : magit-status")) + (thwap/add-key-binding "g s" 'magit-status "Git status (magit entrypoint)")) (provide 'thwap-magit) diff --git a/lib/thwap-nerdtree.el b/lib/thwap-nerdtree.el index e7c1dee..7b34349 100644 --- a/lib/thwap-nerdtree.el +++ b/lib/thwap-nerdtree.el @@ -4,8 +4,7 @@ :straight t :config (global-set-key [f8] 'neotree-toggle) - (define-key thwap-map (kbd "C-n") 'neotree-toggle) - (add-to-list 'thwap-help-lines "C-c t C-n : Toggle Neotree"))) + (thwap/add-key-binding "C-n" 'neotree-toggle "Toggle Neotree"))) (when (and thwap-fm-enable-treemacs (not thwap-fm-enable-neotree)) @@ -28,8 +27,7 @@ treemacs-never-persist nil treemacs-is-never-other-window t treemacs-goto-tag-strategy 'refetch-index))) - (define-key thwap-map (kbd "C-n") 'treemacs) - (add-to-list 'thwap-help-lines "C-c t C-n : Toggle Treemacs")) + (thwap/add-key-binding "C-n" 'treemacs "Toggle Treemacs")) (when (and thwap-fm-enable-treemacs thwap-ui-enable-kaolin-themes (not thwap-fm-enable-neotree)) (kaolin-treemacs-theme)) diff --git a/lib/thwap-projectile.el b/lib/thwap-projectile.el index 16c6005..988759f 100644 --- a/lib/thwap-projectile.el +++ b/lib/thwap-projectile.el @@ -1,7 +1,6 @@ (when thwap-dev-enable-projectile (straight-use-package 'projectile) - (define-key thwap-map (kbd "p") 'projectile-command-map) - (add-to-list 'thwap-help-lines "C-c t p : Projectile commands")) + (thwap/add-key-binding "p" 'projectile-command-map "Projectile commands")) (provide 'thwap-projectile) diff --git a/lib/thwap-yas.el b/lib/thwap-yas.el index 5b1e212..0637e12 100644 --- a/lib/thwap-yas.el +++ b/lib/thwap-yas.el @@ -14,7 +14,6 @@ (yas-global-mode 1)) ;; yasnippet stuff -(define-key thwap-map (kbd "y n") 'yas-new-snippet) -(add-to-list 'thwap-help-lines "C-c t y n : create a new yasnippet") +(thwap/add-key-binding "y n" 'yas-new-snippet "Create a new yasnippet") (provide 'thwap-yas)