about summary refs log tree commit diff
path: root/init/functions.el
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2018-06-18T14·39+0200
committerVincent Ambo <mail@tazj.in>2018-06-18T14·39+0200
commitf0dfc8b06de568e57050510a5b56fcbb725a6733 (patch)
treed5429ee24ec27295752503fbf871bf23738ec730 /init/functions.el
parente743ea28c50ffd8a702b943260f05cbeee642bcc (diff)
feat(functions): Add ivy-browse-repositories function
Quick helper to switch between all relevant projects.
Diffstat (limited to 'init/functions.el')
-rw-r--r--init/functions.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/init/functions.el b/init/functions.el
index 4ca7cedb2797..c0169955a19a 100644
--- a/init/functions.el
+++ b/init/functions.el
@@ -195,6 +195,16 @@ Including indent-buffer, which should not be called automatically on save."
                               (run-at-time (password-store-timeout)
                                            nil 'password-store-clear))))))
 
+(defun ivy-browse-repositories ()
+  "Select a git repository and open its associated magit buffer."
+
+  (interactive)
+  (ivy-read "Repository: "
+            (magit-list-repos)
+            :require-match t
+            :sort t
+            :action #'magit-status))
+
 (defun warmup-gpg-agent (arg &optional exit)
   "Function used to warm up the GPG agent before use. This is
    useful in cases where there is no easy way to make pinentry run