Hello,

I run vim on Solaris, Linux and Cygwin (actually I use only the win32
native version of vim, generally the one compiled by Tony).
And I have one set of scripts for all systems.

* On Tue, Jul 25, 2006 at 12:14:43AM -0700, Gary Johnson <[EMAIL PROTECTED]> 
wrote:
> To that end, I have done a "standard" install of Cygwin, installed the
> "standard" vim for Windows from vim.sf.net, put "C:\Program
> Files\Vim\vim70" in my Windows PATH, added
> 
>     export SHELL
>     
> to my $HOME/.bash_profile, and added the following lines to the top 
> of my _vimrc (C:\Program Files\Vim\_vimrc):
> 
>     if has("win32") && $SHELL == "/bin/bash" && 
> executable("C:/cygwin/bin/bash")
>       " Running in Cygwin.

I though I was detecting cygwin presence on $CYGWIN -- as it is more
likelly to be widelly spread. But it seems I'm using either $OSTYPE or
$TERM. 

More over I don't have any c:/ drive, and the shell can be anything.

BTW, we can also detect cygwin presence with "executable('cygpath')" ;
as long as cygwin paths are in the $PATH, because the windows box is set
to have cygwin in the $PATH, or because vim is launched from cygwin.

> In addition, I have found it necessary to make some changes to some
> plugins (ctags.vim and ccase.vim) following this example in 
> $VIMRUNTIME/ftplugin/perl.vim:

Indeed. Plugins need to transform a few things in order to be portable.
In my plugin system_utils.vim, I provide a few functions that help in
that purpose. I use them in my other plugins when I need to call
external programs like aspell, mkdir, ...

> So my questions to anyone else using Vim and Cygwin on Windows XP 
> are:  Does what I'm doing make sense?

Yes.

> Is there some way to fix the 'shellxquote' problem other than
> modifying every plugin I use as I've done above?

None that I know of.

> Is there a better way of doing any of this?
> 
> I suppose I could build a Cygwin-aware vim binary, but I have
> successfully avoided having to compile anything under Windows so far
> and would really like to avoid that headache.

The problem is deeper than just having the right vim executable. There
are many different vim executables running on various system. As plugin
writers, we have to make our plugins portable. Discarding one vim binary
because there is another (patched) one that is compatible with the
plugin is not the solution.


Note: in case you are interrested, you will found on my web site:
- a shell script that lauches win32-vim from cygwin and that translates
  pathnames (and only pathnames) -> cyg-wrapper.sh
- a plugin that provides a few functions to detect the current system
- .vimrc specific settings according to the current box vim is running
  on
- a few plugins that call external programs (lh-vim-spell, triggers)
- a compiler plugin-filter for cygwin that translates ":make" outputs
  from posix pathnames to windows pathnames. (-> experimental plugin
  BuildToolWrapper (lh-BTW.tar.gz in vim/ressources/)

HTH,

-- 
Luc Hermitte
http://hermitte.free.fr/vim/

Reply via email to