"Edit with VIM" Contextual Menu and Windows Vista 64

One of the first things that I install on any new Windows machine that I get is VIM . I have been using VI for years, and love having it integrated into my Windows Environment. One of my favorite features is the ability to view a file by right clicking on it and selecting the “Edit with VIM” option from the Contextual Menu.

When I installed VIM on Windows Vista 64, everything worked great except that there was no “Edit with VIM” menu option. Well off I went and found the following solution on the Vim on Vista - VIM Tips Wiki . All you have to do is the following:

  1. Open regedit
  2. Navigate to and expand: Computer\HKEY_CLASSES_ROOT\*\shell Note: Literally a * ; should be first in list
    1. Right click on shell
      1. Select New -> Key
    2. Right Click on the new key, and rename it to: Open with gVIm
    3. Left click on Open with gVIm
      1. In the right hand side, Right Click on (Default) and select Modify
        1. In the Value Data field type: Edit with Vim
    4. Right Click on Open with gVIm
      1. Select New -> Key
    5. Right Click on the new key, and rename it to Command
    6. Left click on Command
      1. In the right hand side, Right Click on (Default) and select Modify
        1. In the Value Data field type: “C:\Program Files (x86)\Vim\vim72\gvim.exe” “%1” Note: quotes (") are important!

Posted on Jun 16, 2009 by Mike Jennings in Open Source | 4 Comments | Permalink



Comments:

Thanks for the tip, worked perfectly on Windows 7 64 bit.

Just one correction -- watch out for the quotation marks. The ones you use in the example will most certainly not go over too well with Windows.

Posted by mitja on August 04, 2009 at 10:42 PM EDT #

Thanks a lot for the tip. The tip worked well, however, I'm used to clicking on a file and hitting Shift+F10 and then the v key to have it open in Vim. Is there a way to restore this functionality?

Posted by eric on August 29, 2009 at 10:08 PM EDT #

I just thought I'd report. I figured it out, instead of "Edit with Vim," (comma there only because that's how English punctuation works) put "Edit with &Vim." (period there only because of English punctuation)

Posted by eric on August 31, 2009 at 09:07 PM EDT #

thanks for the tip - saved my life :-)

btw you can also add "Edit with vim" as a context menu item for files with no extension. Just make the same registry entries but with HKEY_CLASSES_ROOT\.\shell (i.e. "." instead of "*")

Posted by Tim on January 19, 2010 at 05:54 AM EST #

Post a Comment:
Comments are closed for this entry.