summary refs log tree commit diff stats
path: root/doc/examples/bash_automatic_cd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/bash_automatic_cd.sh')
-rw-r--r--doc/examples/bash_automatic_cd.sh21
1 files changed, 0 insertions, 21 deletions
diff --git a/doc/examples/bash_automatic_cd.sh b/doc/examples/bash_automatic_cd.sh
deleted file mode 100644
index 8d72c553..00000000
--- a/doc/examples/bash_automatic_cd.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-# Compatible with ranger 1.4.2 through 1.6.*
-#
-# 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='/tmp/chosendir'
-    /usr/bin/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"'
124'>124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197