Skip to content

Instantly share code, notes, and snippets.

@krompus
Last active March 9, 2016 18:51
Show Gist options
  • Save krompus/3ab1dc957d321e9a3ea2 to your computer and use it in GitHub Desktop.
Save krompus/3ab1dc957d321e9a3ea2 to your computer and use it in GitHub Desktop.
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')
endif
redraw!
endfun
map <Leader>r :call RangerChooser()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment