Monday, December 3, 2012

Re: how to execute ranger from gvim

On 2012-12-03, ping wrote:

> On 08/09/2012 06:02 AM, Sepp Tannhuber wrote:
>>
>> I use the following function from the ranger manual:
>> 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 ,r :call RangerChooser()<CR>

> what's the problem with just :!ranger ?

The function uses Ranger as a file chooser. Vim will edit the file
you've chosen using Ranger in the current Vim instance. Using just
:!ranger will let you edit a file chosen using Ranger, but in a new
Vim instance.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: