[vox-tech] using windows pathnames in cygwin

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Tue Jan 31 16:37:03 PST 2006


Peter Jay Salzman wrote:
> In cygwin, I'd like to type "vi /etc/profile" and have gvim come up, editing
> /etc/profile without necessarily running X.  That means I need to rely on a
> win32 installation of gvim, rather than the gvim that comes with cygwin.
> 
> I've installed win32 gvim in C:\Program Files\vim, but when I do:
> 
>    /cygdrive/c/Program\ Files/Vim/vim64/gvim.exe /etc/profile
> 
> gvim comes up with:
> 
>    "Cannot open swap file for \etc\profile", recovery impossible

This error seems like an odd way to say it couldn't find a file.
If that isn't what it is saying, then something is wrong with your
install of gvim.

> and I find myself editing an empty file.  Eventually, I'd like to make
> "/usr/bin/vi" an alias for "/cygdrive/c/Program Fiels/Vim/vim64/gvim.exe".
> 
> Is there a way to use win32 gvim from within cygwin and have the pathnames
> work out?

This would be my normal invocation:

$ /cygdrive/c/Program\ Files/Vim/vim64/gvim.exe "C:/cygwin/etc/profile"

I've never used gvim.exe, but one of the issues that comes up in using
Windows versions of posix tools in cygwin is the newline problem...
the windows versions may or may not handle the normal cygwin LF
newlines properly.  gvim probably can... others don't always.

You may be able to get what you are after with a script that prepends
"C:/cygwin/" to the first argument if it begins with a "/".

I don't know how you can completely forget that Windows is there...
it doesn't let me forget, and I am just resigned to that.

-- 
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                       Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------


More information about the vox-tech mailing list