Alias to open gVim (Cream version) from Cygwin shell

1

1

I'm using the Cream version of gVim, and i'd like to make an alias to open files from a Cygwin shell in Cream. Running the gVim executable from Cygwin gives the following error (in a Windows cmd window) :

/bin/zsh /c <symlink> ■c
The system cannot find the file specified.
shell returned 1
Hit any key to close this window..

.

Andrei

Posted 2010-08-22T12:32:23.533

Reputation: 996

Answers

1

cyg-wrapper solves this issue -- by applying realpath+cygpath.

EDIT: Yesterday, I've seen this on vim mailing list. It looks like a recent regression.

Luc Hermitte

Posted 2010-08-22T12:32:23.533

Reputation: 1 575

1

I had this issue, and it turned out to be a corrupted _vimrc file. My _vimrc file somehow had the following contents:

!<symlink> ... some non-human readable characters ...

Remove or fix the _vimrc file, and the error should go away.

emallove

Posted 2010-08-22T12:32:23.533

Reputation: 432

0

You get that error because your PATH does not include the parent directory of the gvim executable. Assuming that you installed the latest version of Vim, 7.3, in the default location, this alias should work.

alias gvim='/cygdrive/c/Program\ Files/vim/vim73/gvim.exe'

garyjohn

Posted 2010-08-22T12:32:23.533

Reputation: 29 085

Thanks, but it still gives the same error. I did notice one thing though: when I close the cmd window, there's a gVIM dialog box underneath with a single button with the message :!<symlink>ÿþc. It suppose it has something to do with the fact that gvim.exe is actually a Windows symlink and that Cygwin can't properly handle it. When I click on it gVIM works fine but it's still an annoyance... – Andrei – 2010-08-24T13:22:18.720

That used to work. I just got back to my Cygwin 1.7 system which has a fresh install of Vim from the Cream site and verified the behavior you're seeing. I'll look into it. – garyjohn – 2010-08-26T16:19:25.907

1The system on which this worked for me has a ~/_vimrc shared by both Windows gvim and Cygwin vim. The system on which this fails has a $HOME/.vimrc that is a Cygwin symlink to the regular file $HOMEDRIVE/$HOMEDIR/_vimrc. I "fixed" the problem by invoking gvim.exe like this: ( unset HOME; /cygdrive/c/Program\ Files\Vim/vim73/gvim.exe; ), which caused gvim.exe to read the real file instead of the symlink. So the problem could be as you said that gvim.exe is a Windows symlink or that your ~/.vimrc is a Cygwin symlink. I didn't try Luc's suggestion. – garyjohn – 2010-08-26T18:37:57.530