summaryrefslogtreecommitdiff
path: root/lisp/init-git.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-09-03 01:00:23 -0400
committerKyle Meyer <kyle@kyleam.com>2015-09-03 01:00:23 -0400
commitf2c5a359762d8f95c7da5f5b650cfa8ac123568d (patch)
tree5e341b885991236f253812a822a9fe0d9a25c0ac /lisp/init-git.el
parentd3d907c230e5424b0cb2d8a908eee6843f480466 (diff)
downloademacs.d-f2c5a359762d8f95c7da5f5b650cfa8ac123568d.tar.gz
Add magit-refs-toggle-tags command
Diffstat (limited to 'lisp/init-git.el')
-rw-r--r--lisp/init-git.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/init-git.el b/lisp/init-git.el
index a219093..4c2fb23 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -487,6 +487,16 @@ prompt for REV-A."
"" "NOT ")
rev-b))
+(defun km/magit-refs-toggle-tags ()
+ "Toggle showing tags in `magit-refs-mode'.
+This only affects the current buffer and is useful if you do not
+show tags by default."
+ (interactive)
+ (if (memq 'magit-insert-tags magit-refs-sections-hook)
+ (remove-hook 'magit-refs-sections-hook 'magit-insert-tags t)
+ (add-hook 'magit-refs-sections-hook 'magit-insert-tags t t))
+ (magit-refresh-buffer))
+
(define-key ctl-x-4-map "g" 'magit-find-file-other-window)
(define-key km/file-map "g" 'magit-find-file)
@@ -508,6 +518,8 @@ prompt for REV-A."
(define-key magit-refs-mode-map "j" 'km/magit-avy-goto-subword-1)
(define-key magit-cherry-mode-map "j" 'km/magit-avy-goto-subword-1)
+ (define-key magit-refs-mode-map (kbd "C-c C-t") 'km/magit-refs-toggle-tags)
+
(define-key magit-process-mode-map (kbd "C-c C-k") 'magit-process-kill)
(define-prefix-command 'km/magit-map)