about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-12-20T08·49+0300
committerclbot <clbot@tvl.fyi>2021-12-20T08·52+0000
commit6328f1c7c8df25d5596d8dc97c6ab50778dbb0a9 (patch)
tree870c21abe9af2ee86b64cee0fb918da4e88c09db
parent9f9644c41fd9d18bff1cf6d0034dbabd5bc75b15 (diff)
feat(tazjin/emacs): add zoxide-open-magit and a binding for it r/3327
Change-Id: Ibe3264769ab6e6d1400088e8a72d3ef22dc4cd78
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4514
Reviewed-by: tazjin <mail@tazj.in>
Autosubmit: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
-rw-r--r--users/tazjin/emacs/config/bindings.el3
-rw-r--r--users/tazjin/emacs/config/functions.el5
2 files changed, 8 insertions, 0 deletions
diff --git a/users/tazjin/emacs/config/bindings.el b/users/tazjin/emacs/config/bindings.el
index 21cca06cc8..916d947756 100644
--- a/users/tazjin/emacs/config/bindings.el
+++ b/users/tazjin/emacs/config/bindings.el
@@ -49,6 +49,9 @@
 ;; Open the depot
 (global-set-key (kbd "s-s d") #'tvl-depot-status)
 
+;; Open any repo through zoxide
+(global-set-key (kbd "s-s r") #'zoxide-open-magit)
+
 ;; Add subthread collapsing to notmuch-show.
 ;;
 ;; C-, closes a thread, C-. opens a thread. This mirrors stepping
diff --git a/users/tazjin/emacs/config/functions.el b/users/tazjin/emacs/config/functions.el
index 5963d142c1..ba7301e794 100644
--- a/users/tazjin/emacs/config/functions.el
+++ b/users/tazjin/emacs/config/functions.el
@@ -325,4 +325,9 @@ the GPG agent correctly."
                     (if-let ((pr (project-current)))
                         (project-root pr)))))
 
+(defun zoxide-open-magit ()
+  "Query Zoxide for paths and open magit in the result."
+  (interactive)
+  (zoxide-open-with nil #'magit-status-setup-buffer))
+
 (provide 'functions)