about summary refs log tree commit diff stats
path: root/README
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-02-15 01:03:59 +0000
committerhut <hut@lavabit.com>2011-02-15 01:03:59 +0000
commitd008817c6d3ea828e12bed2c271c9ae36f80cbda (patch)
tree49e62d666d8f7432d1769e757baca051891505ea /README
parent9a2ec2b421e87e815806b4a7ae7452fb84f2027e (diff)
downloadranger-d008817c6d3ea828e12bed2c271c9ae36f80cbda.tar.gz
Added --choosedir, a more logical alternative to --fail-unless-cd
also updated the bash script in README to use the new option
Diffstat (limited to 'README')
-rw-r--r--README9
1 files changed, 4 insertions, 5 deletions
diff --git a/README b/README
index c1462ec3..cf0e3577 100644
--- a/README
+++ b/README
@@ -96,12 +96,11 @@ Combine Ranger With Other Applications
 Add this to your ~/.bashrc to use ranger as a directory switcher:
 
 function ranger-cd {
-  before="$(pwd)"
-  python2.6 /the/path/to/ranger/ranger.py --fail-unless-cd "$@" || return 0
-  after="$(grep \^\' ~/.config/ranger/bookmarks | cut -b3-)"
-  if [[ "$before" != "$after" ]]; then
-    cd "$after"
+  ranger --choosedir=/tmp/chosen
+  if [ -f /tmp/chosen -a "$(cat /tmp/chosen)" != "$(pwd | tr -d "\n")" ]; then
+    cd "$(cat /tmp/chosen)"
   fi
+  rm -f /tmp/chosen
 }
 bind '"\C-o":"ranger-cd\C-m"'