about summary refs log tree commit diff
path: root/users/tazjin
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin')
-rw-r--r--users/tazjin/emacs/config/bindings.el4
-rw-r--r--users/tazjin/emacs/config/functions.el10
2 files changed, 9 insertions, 5 deletions
diff --git a/users/tazjin/emacs/config/bindings.el b/users/tazjin/emacs/config/bindings.el
index 1feb9faf8186..85643657010b 100644
--- a/users/tazjin/emacs/config/bindings.el
+++ b/users/tazjin/emacs/config/bindings.el
@@ -49,8 +49,8 @@
 ;; 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)
+;; Open any project through zoxide
+(global-set-key (kbd "s-s r") #'zoxide-open-project)
 
 ;; Add subthread collapsing to notmuch-show.
 ;;
diff --git a/users/tazjin/emacs/config/functions.el b/users/tazjin/emacs/config/functions.el
index 39334c95a509..835b4e44d518 100644
--- a/users/tazjin/emacs/config/functions.el
+++ b/users/tazjin/emacs/config/functions.el
@@ -351,10 +351,14 @@ by looking for a `Cargo.toml' file."
                     (if-let ((pr (project-current)))
                         (project-root pr)))))
 
-(defun zoxide-open-magit ()
-  "Query Zoxide for paths and open magit in the result."
+(defun zoxide-open-project ()
+  "Query Zoxide for paths, and open the result as appropriate (magit or dired)."
   (interactive)
-  (zoxide-open-with nil #'magit-status-setup-buffer))
+  (zoxide-open-with
+   nil
+   (lambda (path)
+     (condition-case err (magit-status-setup-buffer path)
+       (magit-outside-git-repo (dired path))))))
 
 (defun toggle-nix-test-and-exp ()
   "Switch between the .nix and .exp file in a Tvix/Nix test."