Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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, ~/.vimrc and 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 $HOME is 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:

:!<symlink><ff><fe>p

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 vimrc file, 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 vimrc file.
  • 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.
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Well, this was about the dumbest fix I've ever seen. Launching gVim from the command line and manually specifying -u C:\Users\<myusername>\_vimrc not only prevented the error messages from popping up that time, it has apparently fixed my setup so that no matter how I launch Vim I no longer see the error messages described in the question.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.