diff options
Diffstat (limited to 'examples/bash_automatic_cd.sh')
-rw-r--r-- | examples/bash_automatic_cd.sh | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/examples/bash_automatic_cd.sh b/examples/bash_automatic_cd.sh deleted file mode 100644 index 294f3aaa..00000000 --- a/examples/bash_automatic_cd.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# Compatible with ranger 1.4.2 through 1.7.* -# -# Automatically change the current working directory after closing ranger -# -# This is a shell function to automatically change the current working -# directory to the last visited one after ranger quits. -# To undo the effect of this function, you can type "cd -" to return to the -# original directory. - -ranger_cd() { - temp_file="$(mktemp -t "ranger_cd.XXXXXXXXXX")" - ranger --choosedir="$temp_file" -- "${@:-$PWD}" - if chosen_dir="$(cat -- "$temp_file")" && [ -n "$chosen_dir" ] && [ "$chosen_dir" != "$PWD" ]; then - cd -- "$chosen_dir" - fi - rm -f -- "$temp_file" -} - -# This binds Ctrl-O to ranger-cd: -bind '"\C-o":"ranger-cd\C-m"' |