Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just installed gvim on windows 7 for the first time, and I'm having a problem opening some files. When I open files vim seems to flash up a cmd window for a few second before closing it (too quickly to make out the contents,) and I end up with a C:/Program folder, and a /Files/vim/vimfiles/doc/ in the directory of the file I just opened. I can see it's trying to access C:/Program Files/vim/vimfiles/doc, which is where vim is installed, however it's choking on the space, and I'm not familiar enough with gvim to work out why. Any and all ideas are greatly appreciated.

share|improve this question
what version of 7 your are using ? – ukanth Jun 2 '10 at 10:41
dxdiag tells me I'm using "Windows 7 Professional 32-bit (6.1, Build 7600)" – Oscar Duignan Jun 2 '10 at 11:18
up vote 0 down vote accepted

Thats because vim is actually vim.bat and is a console program. You should associate gvim as the default program.

share|improve this answer
No, I'm opening them within gvim. The cmd window flashes up when I open files; so if I'm inside gvim, and I use :e <filename> then gvim pauses and a cmd window flashes up then disappears, and the file is opened. The pause I can live with, it's just really inconvenient to have to go through and delete all the stray Directories which are created when this happens. – Oscar Duignan Jun 3 '10 at 11:30
Okay, its actually opening vim.bat from your %windir% %windir% stands for windows installation directory. You should set your vim directory C:\Program Files\vim in path before C:\windows, and all should be fine. – 0fnt Jun 3 '10 at 19:18
Ah, thank you for explaining! You've saved me a lot of confusion, I'm not sure I could have worked that out on my own. – Oscar Duignan Jun 4 '10 at 8:57

Do you use an alias or a batch-file to open your files with vim ?

Didn't you forget to surround the parameters to vim with quotes ?

share|improve this answer
Nope, this happens inside gvim, so I'm just opening things with :e / :vsp / :sp / nerdtree. – Oscar Duignan Jun 3 '10 at 11:31

Your Answer


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.