I'm trying to configure the native Windows Vim/gVim and the Cygwin Vim/gVim to behave nicely together. To this end, I created symlinks,
C:\Users\<myusername>\_vimrc, that both point to a common
vimrc file containing my actual shared Vim configuration. (I did a similar trick with another config file that is sourced by my
vimrc.) (Note that
C:\Users\<myusername>, so the above links are in the same directory; I just wanted to emphasize that one is used by Cygwin while the other is used by the Windows-native Vim.) The
.vimrc file was created using
ln -s in Cygwin, while the
_vimrc file was created using the
mklink Windows command.
This worked fine until I moved the location of the actual
vimrc file to which the links point. I faithfully corrected the Cygwin and Windows symlinks; now Cygwin gVim correctly finds the rc file, but Windows gives the following error:
First, A command-prompt window pops up with the following message:
C:\windows\system32\cmd.exe /c <symlink> ■p
The system cannot find the file specified.
shell returned 1
Hit any key to close this window...
When I hit a key, that window closes and a little gVim pop-up window appears with the following message, which I assume is the Vim command that causes the problem:
When I close this window, gVim starts correctly, with the correct settings from my vimrc file. This last part boggles my mind somewhat, because I think it means that the
_vimrc symlink is actually configured correctly--but if that's the case, why am I still getting an error?
Now, some notes:
- When I first moved the
vimrcfile, my "correction" to the Windows symlink was to make it point to the Cygwin symlink. The error messages shown were the same, but when gVim finally started it did not load the configuration from the
- I tried deleting the Windows symlinks entirely; I also tried uninstalling and re-installing the native gVim. Neither of these changed the behavior.
- I see there are a couple other questions about using a setup somewhat like this, but I don't see any describing a problem very similar to mine.