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 have a shortcut to open vim, but I would like to create a shortcut to open the currently selected file in windows explorer with vim (if that is not the program associated with the file's type).

Using the shortcut for the executable opens it with no file selected.

share|improve this question

Create an entry in HKEY_CLASSES_ROOT\*\shell

1. Right-click it and choose new key - Name it "Open with VIM"
2. Right Click the new key - choose new key - and name it "command"
3. Set that key's default value to "PathToVIM" "%1" with quotes

It is a mouse shortcut, instead of keyboard. From then on right clicking on any file with give a "Open with VIM" in its context menu.

share|improve this answer
  1. Right-clock the file you want to open with VIM
  2. Select "Open with"
  3. Select "Choose default program..."
  4. Browse to the VIM executable location
  5. Make sure "Always used the selected program to open this kind of file" is checked
  6. Click OK

From now on, this file type will be opened by VIM.

share|improve this answer
I don't want vim to become the new default for that file type. I just want to make it easier to open the file type with vim. For instance, I want html files to default to a browser, but I shouldn't have to search through the menus for the "open with" every time I want to open it with an editor. – DanB Aug 15 '11 at 4:41
Then set is as the default HTML editor in your default browser (look for instructions o how to set default applications for your preferred browser) – Traveling Tech Guy Aug 15 '11 at 5:34
My goal is to open any file in my editor of choice (which happens to be VIM) with a keystroke-combination. I only gave html as an example, but I don't understand how setting my editor in the browser achieves that goal even for html files. – DanB Aug 15 '11 at 13:05

You must log in to answer this question.

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