Windows – How to set an “open with” keyboard shortcut in windows 7

key-bindingkeyboard shortcutswindows 7

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.

Best Answer

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.