How to use cyg-wrapper to fork a new tab in win32 gvim

Posted by Peter Nore on Super User See other posts from Super User or by Peter Nore
Published on 2011-06-18T04:12:24Z Indexed on 2011/06/21 0:24 UTC
Read the original article Hit count: 672

Filed under:
|
|
|

I would like to set up an alias in my cygwin .bashrc that translates pathnames unix-to-dos and passes them to windows gvim in a new tab of an existing instance. I am trying to use Luc Hermitte's cyg-wrapper script for running native win32 applications from Cygwin as per this vim tip. Luc's example of how to use his script is:

alias vi= 'cyg-wrapper.sh "C:/Progra~1/Edition/vim/vim63/gvim.exe"
    --binary-opt=-c,--cmd,-T,-t,--servername,--remote-send,--remote-expr'

I do not understand this example because most of these vim parameters (-c,--cmd,--servername,--remote-send,--remote-expr, etc) require more information, and I have not found any example of how to supply the additional information to cyg-wrapper.sh. For example, calling

C:/Progra~1/Edition/vim/vim63/gvim.exe --servername=GVIM 
   --remote-tab-silent file1 &

will open file1 in a new tab of existing (or non existing) instance GVIM, but calling gvim --servername accomplishes nothing on its own. Unfortunately, though, the corresponding cyg-wrapper phrase does not work:

cyg-wrapper.sh "C:/Progra~1/Edition/vim/vim63/gvim.exe"
    --binary-opt=--servername=GVIM,--remote-tab-silent --fork=2 file1

If ran twice, this actually opens up two instances of gvim; it is as if the servername 'GVIM' is being stripped and ignored. How do you supply a servername to gvim --servername or a .vimrc to gvim -u using cyg-wrapper.sh?

Furthermore, why is it that programs must be passed to cyg-wrapper.sh in the relatively obscure "mixed form?" For example, if I try

cyg-wrapper.sh "/cygdrive/c/path/to/GVimPortable.exe"
        --binary-opt=--servername=GVIM,--remote-tab-silent --fork=2

I get "Invalid switch - "/cygdrive"."

See also:

© Super User or respective owner

Related posts about vim

Related posts about cygwin