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"'
 
n' href='/akspecs/ranger/blame/HACKING?h=v1.7.2&id=62cd83bace8e77cd1ff7028da6cf65d0d1defa27'>^
a2853ab6 ^
f8f6f7f9 ^
f8f6f7f9 ^

29028631 ^

a2853ab6 ^
3ee05c16 ^

f8f6f7f9 ^






29028631 ^
f8f6f7f9 ^









f8f6f7f9 ^






dade4742 ^
fd29d7e6 ^
0df1d653 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95