]> git.rmz.io Git - dotfiles.git/blobdiff - zsh/lib/ranger.zsh
nvim: add FPP copyright snippet
[dotfiles.git] / zsh / lib / ranger.zsh
index 1fab1ae446a3c0ccac5af1981682277ef32b6d9f..f59c7f550bf8aaadee97fd7ae0ef43ec03562f65 100644 (file)
@@ -3,11 +3,13 @@ if (( ! $+commands[ranger] )); then
 fi
 
 # Auto cd into rangers directory
 fi
 
 # Auto cd into rangers directory
+ranger_cmd=$(whence -p ranger)
 function ranger {
     tempfile=$(mktemp /tmp/ranger-dirXXX)
 function ranger {
     tempfile=$(mktemp /tmp/ranger-dirXXX)
-    /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
+    $ranger_cmd --choosedir="$tempfile" "${@:-$(pwd)}"
     test -f "$tempfile" &&
     if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
     test -f "$tempfile" &&
     if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
+        echo "$(cat "$tempfile")"
         cd -- "$(cat "$tempfile")"
     fi
     rm -f -- "$tempfile"
         cd -- "$(cat "$tempfile")"
     fi
     rm -f -- "$tempfile"