Browse Source

initial commit

master
Alison Watson 1 year ago
commit
c687d085bb
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      plugin/ranger.vim

+ 24
- 0
plugin/ranger.vim View File

@@ -0,0 +1,24 @@
function! RangeChooser()
let temp = tempname()
exec 'silent !ranger --choosefiles=' . shellescape(temp)
if !filereadable(temp)
" Nothing to read.
redraw!
return
endif
let names = readfile(temp)
if empty(names)
" Nothing to open.
redraw!
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>f :<C-U>RangerChooser<CR>

Loading…
Cancel
Save