Tip #381: Running the win32-version of Vim from cygwin
tip karma |
Rating 33/15, Viewed by 2352
|
created: |
|
December 3, 2002 8:40 |
|
complexity: |
|
basic |
author: |
|
Luc Hermitte |
|
as of Vim: |
|
5.7 |
This tip does not only concern Vim, but any native win32 application (NWA) we may want to run from cygwin.
Note: I call a "native win32 application", any program that has not been specifically compiled to run on cygwin.
Typical examples are internet explorer, yap, acrobat reader, ... and of course the win32 version of Vim available on this site or on http://cream.sourceforge.net.
The problem with running NWAs from cygwin comes from the fact that paths in cygwin can be expressed in ways that NWAs can't understand. Indeed from cygwin, we can also:
- express paths as *nix-like paths ; e.g. /etc/profile
- use paths that, as a matter of fact, are symbolic links.
So, to come around this issue, here is a shell script that can be used to define aliases:
http://hermitte.free.fr/cygwin/cyg-wrapper.sh
[More help available on: http://hermitte.free.fr/cygwin#Win32]
All you have to do is to drop it into one directory from your $PATH, and define into your .profile something like:
alias gvim='cyg-wrapper.sh "C:/Progra~1/Edition/vim/vim61/gvim.exe" -c'
Notes:
- under MsWindows 9x, I had to writte the path to gvim.exe in the windows short form
- the '-c' is here to tell cyg-wrapper.sh that: when calling VIM, the parameter following '-c' is not a path.
This enables to write:
gvim -c '/^$/' foo.xxx
Regarding the use of *nix-like paths from win32-VIM, check Johannes Zellner's plugin (cygwin.vim) that will convert *nix paths into MsWindows paths on file-opening -- there are different autocommand to add, but it will give you the main idea.
Last point, the win32 version of Vim can not expand paths expressed in the *nix way ;
e.g. ':sp /etc/pr<tab>' won't expand.
<<Using gvim as frontend for dbx |
Search and replace in all open buffers >>
Additional Notes
|