summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/HACKING2
-rw-r--r--doc/examples/vim_file_chooser.vim37
-rw-r--r--doc/ranger.pod10
-rwxr-xr-xdoc/tools/print_colors.py16
4 files changed, 50 insertions, 15 deletions
diff --git a/doc/HACKING b/doc/HACKING
index c9e458ea..68a1a942 100644
--- a/doc/HACKING
+++ b/doc/HACKING
@@ -16,7 +16,7 @@ Patches
 
 Send patches, created with "git format-patch", to the email adress
 
-    hut@lavabit.com
+    hut@lepus.uberspace.de
 
 If you plan to do major changes, or many changes over time, I encourage
 you to create a fork on GitHub, Gitorious or any other site.
diff --git a/doc/examples/vim_file_chooser.vim b/doc/examples/vim_file_chooser.vim
index 4f5fa3f2..68947d2d 100644
--- a/doc/examples/vim_file_chooser.vim
+++ b/doc/examples/vim_file_chooser.vim
@@ -2,16 +2,33 @@
 "
 " Add ranger as a file chooser in vim
 "
-" If you add this function and the key binding to the .vimrc, ranger can be
-" started using the keybinding ",r".  Once you select a file by pressing
-" enter, ranger will quit again and vim will open the selected file.
+" If you add this code to the .vimrc, ranger can be started using the command
+" ":RagerChooser" or the keybinding "<leader>r".  Once you select one or more
+" files, press enter and ranger will quit again and vim will open the selected
+" files.
 
-fun! RangerChooser()
-    exec "silent !ranger --choosefile=/tmp/chosenfile " . expand("%:p:h")
-    if filereadable('/tmp/chosenfile')
-        exec 'edit ' . system('cat /tmp/chosenfile')
-        call system('rm /tmp/chosenfile')
+function! RangeChooser()
+    let temp = tempname()
+    " The option "--choosefiles" was added in ranger 1.5.1. Use the next line
+    " with ranger 1.4.2 through 1.5.0 instead.
+    "exec 'silent !ranger --choosefile=' . shellescape(temp)
+    exec 'silent !ranger --choosefiles=' . shellescape(temp)
+    if !filereadable(temp)
+        " Nothing to read.
+        return
     endif
+    let names = readfile(temp)
+    if empty(names)
+        " Nothing to open.
+        return
+    endif
+    " Edit the first item.
+    exec 'edit ' . fnameescape(names[0])
+    " Add any remaning items to the arg list/buffer list.
+    for name in names[1:]
+        exec 'argadd ' . fnameescape(name)
+    endfor
     redraw!
-endfun
-map ,r :call RangerChooser()<CR>
+endfunction
+command! -bar RangerChooser call RangeChooser()
+nnoremap <leader>r :<C-U>RangerChooser<CR>
diff --git a/doc/ranger.pod b/doc/ranger.pod
index 713878f6..b48cdcf7 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -530,6 +530,11 @@ You can display the "real" cumulative size of directories by using the command
 will not be updated automatically.  You can choose to update it automatically
 though by turning on this option.
 
+=item cd_bookmarks [bool]
+
+Specify whether bookmarks should be included in the tab completion of the "cd"
+command.
+
 =item collapse_preview [bool] <zc>
 
 When no preview is visible, should the last column be squeezed to make use of
@@ -622,6 +627,11 @@ Preview files in the preview column?
 
 Draw images inside the console with the external program w3mimgpreview?
 
+=item preview_max_size [int]
+
+Avoid previewing files that exceed a certain size, in bytes.  Use a value of 0
+to disable this feature.
+
 =item preview_script [string, none]
 
 Which script should handle generating previews?  If the file doesn't exist, or
diff --git a/doc/tools/print_colors.py b/doc/tools/print_colors.py
index ce040b33..b3eba749 100755
--- a/doc/tools/print_colors.py
+++ b/doc/tools/print_colors.py
@@ -10,10 +10,18 @@ from curses import *
 @wrapper
 def main(win):
     def print_all_colors(attr):
-        for c in range(0, curses.COLORS):
-            init_pair(c, c, -1)
-            win.addstr(str(c) + ' ', color_pair(c) | attr)
-    use_default_colors()
+        for c in range(-1, curses.COLORS):
+            try:
+                init_pair(c, c, 0)
+            except:
+                pass
+            else:
+                win.addstr(str(c) + ' ', color_pair(c) | attr)
+    start_color()
+    try:
+        use_default_colors()
+    except:
+        pass
     win.addstr("available colors: %d\n\n" % curses.COLORS)
     print_all_colors(0)
     win.addstr("\n\n")