Last active
August 29, 2015 14:19
-
-
Save andykais/ae652ef34b164a5912fd to your computer and use it in GitHub Desktop.
after ranger quits, cd to the chosen directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ranger() { | |
tempfile='/tmp/chosendir' | |
/usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}" | |
test -f "$tempfile" && | |
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then | |
cd -- "$(cat "$tempfile")" | |
fi | |
rm -f -- "$tempfile" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment