1 # Compatible with ranger 1.4.2 through 1.7.*
3 # Automatically change the directory in bash after closing ranger
5 # This is a bash function for .bashrc to automatically change the directory to
6 # the last visited one after ranger quits.
7 # To undo the effect of this function, you can type "cd -" to return to the
12 /usr
/bin
/ranger
--choosedir="$tempfile" "${@:-$(pwd)}"
13 test -f "$tempfile" &&
14 if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
15 cd -- "$(cat "$tempfile")"
20 # This binds Ctrl-O to ranger-cd:
21 bind '"\C-o":"ranger-cd\C-m"'