summary refs log tree commit diff stats
path: root/examples/bash_automatic_cd.sh
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-12-31 15:10:37 +0100
committertoonn <toonn@toonn.io>2019-12-31 15:10:37 +0100
commit73b9d457d461d9f242f0dfb14643c08c0377193b (patch)
tree65f28651cf34e4e5dff4fd9c31462dd896c99e88 /examples/bash_automatic_cd.sh
parent219413fa6fa8ff103a633bebf8535768456a5be6 (diff)
parent5dc0d60a56679da5f98cfc8a03273ccafa6d016a (diff)
downloadranger-73b9d457d461d9f242f0dfb14643c08c0377193b.tar.gz
Merge branch 'dmitmel-examples-bash-automatic-cd'
Diffstat (limited to 'examples/bash_automatic_cd.sh')
-rw-r--r--examples/bash_automatic_cd.sh21
1 files changed, 0 insertions, 21 deletions
diff --git a/examples/bash_automatic_cd.sh b/examples/bash_automatic_cd.sh
deleted file mode 100644
index 04b58e24..00000000
--- a/examples/bash_automatic_cd.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-# Compatible with ranger 1.4.2 through 1.7.*
-#
-# Automatically change the directory in bash after closing ranger
-#
-# This is a bash function for .bashrc to automatically change the 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.
-
-function ranger-cd {
-    tempfile="$(mktemp -t tmp.XXXXXX)"
-    ranger --choosedir="$tempfile" "${@:-$(pwd)}"
-    test -f "$tempfile" &&
-    if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
-        cd -- "$(cat "$tempfile")"
-    fi
-    rm -f -- "$tempfile"
-}
-
-# This binds Ctrl-O to ranger-cd:
-bind '"\C-o":"ranger-cd\C-m"'