mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
13 lines
316 B
Bash
13 lines
316 B
Bash
# 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
|