When I try to open a file in an Eclipse project in gvim (using Eclipse's "open with -> other"), gvim seems to skip loading the global gvimrc and vimrc files and opens a bare white window with the default settings. Is there any way I can configure the command line Eclipse uses to launch gvim to add in the -u and -U options to specify the configuration files manually?


I did not find an option for that in the Eclipse preferences. I found the respective config file to be <Eclipse Workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.workbench.prefs but I didn't find a place to plug parameters into that XML.

So what you can do is use a batch file which runs the executable with parameters. Maybe when you installed vim, you already generated C:\Windows\gvim.bat (or more generally %WINDIR%\gvim.bat). Otherwise you can create a dummy batch yourself, e.g. gvim.bat in your vim directory, a text file containing the following one-liner:

%~dp0vim73\gvim.exe -u %~dp0_vimrc %*
  • %~dp0 expands to the directory path of the batch file itself, which is available as the invisible parameter %0.
  • %* means "all (other) parameters (%1 %2 %3 …)" - this is where Eclipse will pass through the name of the text file to edit

Note that it works fine for me out of the box, without the batch workaround. So instead of specifiying the vimrc manually, you could try finding out why your config isn't loaded in the first place and fixing that by consulting the :help vimrc on where vim looks for rc files on startup.

For other approaches to vimming with Eclipse, check out https://stackoverflow.com/questions/597117/painless-integration-of-eclipse-with-vim

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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