summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-10-17 01:02:37 -0400
committerKyle Meyer <kyle@kyleam.com>2014-10-17 01:02:37 -0400
commite4985555a4d5e381e626e0e79cc6115a7dbc7ca9 (patch)
tree0512b191161d9e08c03519cf4dcbcdde24c74428
parent5385b01243cfdbd05d1708cf4d928664cd1e3047 (diff)
downloademacs.d-e4985555a4d5e381e626e0e79cc6115a7dbc7ca9.tar.gz
Add command magit-show-project-commit-under-point
-rw-r--r--lisp/init-git.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/init-git.el b/lisp/init-git.el
index b2c03e4..d78655d 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -32,6 +32,14 @@ This is useful for commit IDs in files and log messages."
(--when-let (thing-at-point 'word)
(magit-show-commit it)))
+(defun km/magit-show-project-commit-under-point ()
+ "Select a project and run `km/magit-show-project-commit-under-point'."
+ (interactive)
+ (--when-let (thing-at-point 'word)
+ (let ((projectile-switch-project-action
+ '(lambda () (magit-show-commit it))))
+ (projectile-switch-project))))
+
(defun km/magit-push-all ()
"Push all branches."
(interactive)
@@ -141,6 +149,7 @@ START-POINT set to the current branch.
(define-prefix-command 'km/git-map)
(global-set-key (kbd "C-c g") 'km/git-map)
(define-key km/git-map "c" 'km/magit-show-commit-under-point)
+(define-key km/git-map "C" 'km/magit-show-project-commit-under-point)
(define-key km/git-map "u" 'km/magit-auto-commit)