Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I've tried the usual process.

  • Open Properties of a file of the type I want to change
  • Select the "Change" button after "Opens With":
  • Browse to C:\Program Files\vim\vim73\gvim.exe
  • Select OK

What I expect to happen: Vim should appear in the "Other Programs" list

What happens: Vim does not appear anywhere in the list, the first choice on the list (notepad) is still selected.

Some advice I saw online indicated that I should add a registry entry that the installer missed. So I added "C:\Program Files\vim\vim73\gvim.exe" "%1" to [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\gvim.exe\shell\open\command]. This didn't seem to help.

Any idea what I'm missing here.

EDIT: well, this is interesting. I can set vim.exe to be the default application, just not gvim.exe.

share|improve this question
up vote 3 down vote accepted

There is a way to associate your favourite editor with a given file type by means of command line tools instead of hacking the registry.

First, check if there is already a file type associated with the given extension, e.g. with .txt

C:\Temp> assoc | findstr \.txt

The result will be something like this

.txt=txtfile

Now tell Windows to open files of this type with GVim

 C:\Temp> ftype txtfile="C:\Program Files (x86)\Vim\vim74\gvim.exe" --remote-silent "%1"

The --remote-silent option causes GVim to open the file in an already existing instance of GVim (without complaining if there isn't any).

share|improve this answer
    
This is much better than what I ended up doing... switching the answer to this one. – user11934 Mar 26 '14 at 4:43

Windows' built-in file type association tools are seriously lacking. However, there are some great freeware utilities from NirSoft that pick up the slack. Try FileTypesMan.

share|improve this answer

I had a similar problem after doing a fresh install of Vim 7.3.3 from the Cream site. What I did to fix the problem was to uninstall Vim, install Vim 7.3 from vim.sf.net, then upgrade to 7.3.3 from the Cream site. I have only a vague understanding of Windows installers so I can't explain exactly why that worked, but it worked for me.

share|improve this answer
    
Yeah... I seem to have hosed this up somewhat more seriously than that. Even if I back down to vim7.2, gvim still won't associate. – user11934 Aug 30 '10 at 16:13

Well... I got it working, but this is ugly. Registry hack

[HKEY_CLASSES_ROOT.cpp] : (Default) : gvim

And then create: [HKEY_CLASSES_ROOT\gvim\shell\open\command] : (Default) : "C:\Program Files\vim\vim73\gvim.exe" "%1"

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .