This file contains 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-cd() { | |
tempfile=$(mktemp) | |
ranger --choosedir="$tempfile" "${@:-$(pwd)}" < $TTY | |
test -f "$tempfile" && | |
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then | |
cd -- "$(cat "$tempfile")" | |
fi | |
rm -f -- "$tempfile" | |
# hacky way of transferring over previous command and updating the screen | |
VISUAL=true zle edit-command-line |