ranger-cd plugin added

This commit is contained in:
Balint Gyapjas 2017-11-21 13:59:21 +01:00
commit 488c80bfd4
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,13 @@
# functions
function ranger-cd {
tempfile="$(mktemp -t tmp.XXXXXX)"
/usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
cd -- "$(cat "$tempfile")"
fi
rm -f -- "$tempfile"
}
# aliases
alias ranger=ranger-cd