about summary refs log tree commit diff
path: root/users
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-05-25T18·56+0200
committerclbot <clbot@tvl.fyi>2022-05-26T11·47+0000
commit71407ab2a6807609b7fc50fcf5ddc6b7eec289af (patch)
tree12a52f9e9094dd96f086f19c04543b5e4cc6a2a4 /users
parent385591d8bf7a89e739a75f76bac1c6dda97e390c (diff)
feat(sterni/emacs): allow launching magit from project-switch r/4124
I always found myself starting a shell or dired to do ,gr right after…

Change-Id: I609bbe13c74a9360608939aca79748a8e59343fd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5672
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'users')
-rw-r--r--users/sterni/emacs/init.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/users/sterni/emacs/init.el b/users/sterni/emacs/init.el
index 97c722431b77..ef5b929b86a9 100644
--- a/users/sterni/emacs/init.el
+++ b/users/sterni/emacs/init.el
@@ -121,11 +121,19 @@
 
 ;; projects (see also evil config)
 
+(defun project-magit ()
+  "Run magit in the current project dir"
+  (interactive)
+  (magit (project-root (project-current t))))
+
+(define-key project-prefix-map (kbd "G") 'project-magit)
+
 (setq project-switch-commands
       '((project-find-file "Find file")
         (project-find-regexp "Find regexp")
         (project-dired "Dired")
-        (project-shell "Shell")))
+        (project-shell "Shell")
+        (project-magit "Magit")))
 
 ;;; Configure packages
 (require 'use-package)