summary refs log tree commit diff stats
path: root/doc/examples/vim_file_chooser.vim
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-04-14 01:46:12 +0200
committerhut <hut@lepus.uberspace.de>2015-04-14 01:46:12 +0200
commiteb9a75caa91f9315d14b17db14af4dfdd71fa82e (patch)
tree26e2d4002756a20666c6a2e6f8d148aafc990afe /doc/examples/vim_file_chooser.vim
parent09b0f2f1044025c8d14d5f7296f43b495cf75ec3 (diff)
parent89146651e07830f15b59b5f076d61741747a0bea (diff)
downloadranger-1.7.0-emacs.tar.gz
Merge branch 'master' into emacs v1.7.0-emacs
Diffstat (limited to 'doc/examples/vim_file_chooser.vim')
-rw-r--r--doc/examples/vim_file_chooser.vim36
1 files changed, 0 insertions, 36 deletions
diff --git a/doc/examples/vim_file_chooser.vim b/doc/examples/vim_file_chooser.vim
deleted file mode 100644
index aa3af763..00000000
--- a/doc/examples/vim_file_chooser.vim
+++ /dev/null
@@ -1,36 +0,0 @@
-" Compatible with ranger 1.4.2 through 1.6.*
-"
-" Add ranger as a file chooser in vim
-"
-" If you add this code to the .vimrc, ranger can be started using the command
-" ":RangerChooser" 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.
-
-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)
-        redraw!
-        " Nothing to read.
-        return
-    endif
-    let names = readfile(temp)
-    if empty(names)
-        redraw!
-        " 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!
-endfunction
-command! -bar RangerChooser call RangeChooser()
-nnoremap <leader>r :<C-U>RangerChooser<CR>