initial commit

master
an 2019-11-25 18:53:34 -05:00
commit c687d085bb
1 changed files with 24 additions and 0 deletions

24
plugin/ranger.vim Normal file
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>