From 0892d743ef1a76ea886121051f14d440d01bb28d Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Thu, 8 Jun 2023 08:25:22 +0200 Subject: [PATCH] add hook to make commit hashes clickable --- lisp/init-magit.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/init-magit.el b/lisp/init-magit.el index 84aeb8d..63c7346 100644 --- a/lisp/init-magit.el +++ b/lisp/init-magit.el @@ -107,16 +107,29 @@ ;; :bind (("s-i" . blamer-show-commit-info) ;; ("C-c i" . ("s-i" . blamer-show-posframe-commit-info))) :defer 20 + :custom (blamer-idle-time 0.3) (blamer-min-offset 70) + :custom-face (blamer-face ((t :foreground "#7a88cf" :background nil :height 140 :italic t))) + :config - (defalias 'blame 'blamer-mode)) + (defalias 'blame 'blamer-mode) + + ;; in addition to blaming I also like to follow the lead, so make + ;; the hash lead to the commit by clicking on it. + (defun blamer-callback-show-commit-diff (commit-info) + (interactive) + (let ((commit-hash (plist-get commit-info :commit-hash))) + (when commit-hash + (magit-show-commit commit-hash)))) + + (setq blamer-bindings '(("" . blamer-callback-show-commit-diff)))) (provide 'init-magit) ;;; init-magit.el ends here