I use Gvim to write code. And use vifm to make file management ( copy, move files, extract tar's ). Sometimes, when navigating in vifm i need to open some file to edit him. Using :e
it opened vim in same window. Is there any way to open file to edit in already opened gvim program?
Vifm. Edit file in opened gvim
1.2k views Asked by user3583807 At
2
There are 2 answers
0
On
Partial solution/workaround (I'm using a mac fwiw):
In vfimrc, define
" yank current file path into the clipboard
nnoremap Cf :!echo -n %c:p | pbcopy %i<cr>
To copy filename and dir into system clipboard
Then in vifm, cursor over file and type
Cf
:!gvim "
<cmd-v>
to paste clipboard, and finish expression with...
"
<enter>
and now that file should open in gvim. It worked for me
You can use Vim's client-server feature to send the
:edit
to the existing GVIM instance. In the terminal Vim / vifm, execute:See
:help remote.txt
for details. You can also open the file in a new tab page with--remote-tab
etc.