Reputation: 1587
My general workflow for going to another project is
projectile-switch-project
which pops up a helm interface for picking a projectmagit-status
Is there a way to combine steps 2-4?
Upvotes: 1
Views: 415
Reputation: 1356
You can choose any git repository known to magit with the universal argument to magit-status
, e.g. C-u M-x magit-status
.
Upvotes: 0
Reputation: 1665
If I understand your question correctly, you may be able to code a little function that does what you need and attach it to projectile-after-switch-project-hook
. At least running magit-status
on that hook (if it's a git project), should be pretty easy to do.
EDIT: Tried it out. It interferes with projectile-switch-project-action
. Good news is that you can just use that instead.
Here's a draft:
(defun my-projectile-switch-project-action ()
(interactive)
;; test for some typical files in my projects
(ignore-errors
(let ((files '("README" "README.md" "build.gradle")))
(while files
(message "Looking for: %s" (first files))
(if (file-exists-p (first files))
(progn
(find-file-other-window (first files))
(setq files nil))
(setq files (rest files))))))
;; now run magit
(if (vc-git-responsible-p default-directory)
(magit-status)))
;; Use the function like this:
(setq projectile-switch-project-action
#'my-projectile-switch-project-action)
I hereby put above code under the GPLv2 or later in addition to StackOverflow's standard license. You can chose under which license you want to receive this code.
Upvotes: 0
Reputation: 3855
projectile-switch-project
which pops up a helm interface for picking a project
If you want to use projectile
with helm
, you could give helm-projectile
a try.
helm-projectile-switch-project
Upvotes: 1
Reputation: 758
If you don't use many projectile features, you can take a look at the built-in project
, whose project-switch-project
will let you select a command after selecting the project like:
Or you may add actions to open magit status for the project to helm like https://occasionallycogent.com/emacs_custom_helm_actions/index.html (something similar embark in helm if I remember correctly)
Upvotes: 1