summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-02-15 00:40:10 +0000
committerhut <hut@lavabit.com>2011-02-15 00:40:10 +0000
commit01c321b1d2b5e8bccfabbf524117554763b4c968 (patch)
treefe9264c1a20d88161709d5311cdcd93f697983ca
parentc3abe35722f24993e369cf589070f3cc8994ee78 (diff)
downloadranger-01c321b1d2b5e8bccfabbf524117554763b4c968.tar.gz
Moved vimscript to README next to the bash script :)
-rw-r--r--README32
-rw-r--r--ranger/help/invocation.py14
2 files changed, 28 insertions, 18 deletions
diff --git a/README b/README
index fc576315..c1462ec3 100644
--- a/README
+++ b/README
@@ -88,10 +88,13 @@ To customize ranger, copy the files from ranger/defaults/ to ~/.config/ranger/
 and modify them according to your wishes.
 
 
-Usage Tips
-----------
+Combine Ranger With Other Applications
+--------------------------------------
+
+1. bash:
+
+Add this to your ~/.bashrc to use ranger as a directory switcher:
 
-The author of ranger uses this function (in ~/.bashrc) to start ranger:
 function ranger-cd {
   before="$(pwd)"
   python2.6 /the/path/to/ranger/ranger.py --fail-unless-cd "$@" || return 0
@@ -102,10 +105,27 @@ function ranger-cd {
 }
 bind '"\C-o":"ranger-cd\C-m"'
 
-This changes the directory after you close ranger and adds the shortcut
-<CTRL-O> for starting ranger.
-
+Now when you run ranger-cd, browse and quit, the directory of the bash process
+you started ranger in will change to the last directroy in ranger.
 To change back to the previous directory, you can type: cd -
+Also, the line with "bind" will map the key <CTRL-O> to start ranger.
+
+2. vim:
+
+Add this function to your ~/.vimrc:
+
+fun Ranger()
+  silent !ranger --choosefile=/tmp/chosen
+  if filereadable('/tmp/chosen')
+    exec 'edit ' . system('cat /tmp/chosen')
+    call system('rm /tmp/chosen')
+  endif
+  redraw!
+endfun
+map <leader>r :call Ranger()
+
+This starts ranger when you type <leader>r (usually \r) and if you open a file
+in ranger it will be opened in the original vim process.
 
 
 Troubleshooting, Getting Help
diff --git a/ranger/help/invocation.py b/ranger/help/invocation.py
index f71e3892..465b0de8 100644
--- a/ranger/help/invocation.py
+++ b/ranger/help/invocation.py
@@ -70,18 +70,6 @@ command line.
       as <target>. This file can be read in a script and used to open a
       certain file which has been chosen with ranger.
 
-      Here, for instance, is a vim script that uses ranger in vim to open files:
-
-      fun Ranger()
-        silent !ranger --choosefile=/tmp/chosen
-        if filereadable('/tmp/chosen')
-          exec 'edit ' . system('cat /tmp/chosen')
-          call system('rm /tmp/chosen')
-        endif
-        redraw!
-      endfun
-      map <leader>r :call Ranger()
-
 (Optional) Positional Argument
       The positional argument should be a path to the directory you
       want ranger to start in, or the file which you want to run.
@@ -96,6 +84,8 @@ Examples:
       ranger --debug /usr/bin
       ranger --confdir=~/.config/ranger --fail-unless-cd
 
+See the README on how to integrate ranger with various external programs.
+
 
 ==============================================================================
 5.2. Python Options
+0000 committer James Booth <boothj5@gmail.com> 2016-01-09 21:37:59 +0000 Added roster room themes' href='/danisanti/profani-tty/commit/themes/batman?id=cd2458c0198bab99655248dd2e1071a862e5ef80'>cd2458c0 ^
0ae975c2 ^

b21edfaa ^

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