diff --git a/lisp/init-magit.el b/lisp/init-magit.el index 524ddf4..9cad030 100644 --- a/lisp/init-magit.el +++ b/lisp/init-magit.el @@ -1,6 +1,5 @@ ;; *** Magit - (when (fboundp 'defhydra) (defhydra hydra-blame (:timeout 30.0 :exit nil) " @@ -24,9 +23,7 @@ Reach this hydra with , magit-blame mode must be active ("M-w" magit-blame-copy-hash nil) ("RET" magit-show-commit nil) ("c" magit-blame-cycle-style nil) - ("q" nil nil :color blue)) - - (global-set-key (kbd "C-x B") 'hydra-blame/body)) + ("q" nil nil :color blue))) ;; Not much to say about Magit (use-package magit @@ -158,7 +155,17 @@ Reach this hydra with , magit-blame mode must be active (magit-restore-window-configuration) (mapc #'kill-buffer buffers))) - (define-key magit-status-mode-map (kbd "q") #'tvd-kill-magit-buffers)) + (define-key magit-status-mode-map (kbd "q") #'tvd-kill-magit-buffers) + + (defun tvd-blame-mode() + (interactive) + (if (not magit-blame-mode) + (progn + (magit-blame) + (hydra-blame/body)))) + + (global-set-key (kbd "C-x B") 'tvd-blame-mode) + ) (use-package blamer