Home > Tips, Tricks, Windows7 > Context menu issues with gVim in Windows 7 x64

Context menu issues with gVim in Windows 7 x64

152929481 e8683b8f06 s Context menu issues with gVim in Windows 7 x64Over the years I’ve developed a serious vi editor habit (mostly from my days working as a system administrator). I use it for coding in PHP, c, and perl because it is convenient and lightweight. Since gVim has been available for Windows, I have never had any issues running it on my home computer and that Edit with VIM right-click context menu item became my best friend. Until now that is. Windows 7 64-bit will run gVim as a 32bit application, but the context menu shortcuts are gone. Here is my workaround.

I found that there are two ways of doing this. One involves messing around with the registry (see Disclaimer), the other involves creating a shortcut.

contextmenu 214x300 Context menu issues with gVim in Windows 7 x64If you want to have the same context menu functionality you got from gVim in 32-bit Windows you’ll need to make the following changes to the [HKEY_CLASSES_ROOT\*\shell\] key in the registry:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Edit with Vim]

[HKEY_CLASSES_ROOT\*\shell\Edit with Vim\command]
@=”C:\\Program Files (x86)\\Vim\\vim72\\gvim.exe \”%1\”

If you are lazy you can simply download my registry export file by clicking here and merge it into your registry (see Disclaimer).

Don’t want to make changes to the registry? Then here is the alternative:

The Send To context menu is pretty customizable in both VISTA and Windows 7. You can add as many shortcuts to this context menu as you want simply by dragging and dropping them into this folder:

C:\Users\<user name>\AppData\roaming\microsoft\windows\SendTo

sent tomenu 300x241 Context menu issues with gVim in Windows 7 x64

So simply adding a gVim shortcut here and voila, an albeit slightly less convenient gVim shortcut now exists on the right-click context menu.

  • Digg
  • Twitter
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Reddit
  • Technorati
  • Slashdot
  • MySpace
  • LinkedIn
  • Google Bookmarks
  • email
  • Live
  • Print
  1. August 6th, 2009 at 01:33 | #1

    Thanx for the fix!!

  2. TechFan
    August 18th, 2009 at 22:17 | #2

    Thanks for the tips. I got gVim working this way. . .I did discover that either of these two methods open very slowly if they path is a UNC path to the file. If I map a drive it is fine though. \\server\share\file opens in almost a minute in comparison to a couple seconds with a mapped drive. . .I didn’t have that issue on 32-bit vista (before this upgrade to Win7)??

  3. September 5th, 2009 at 10:07 | #3

    Thank you!! I was really annoyed after installing Vim on my new Win7 install and the Edit with Vim option wasn’t there. Much much better now!

  4. noter
    September 5th, 2009 at 23:41 | #4
  5. September 8th, 2009 at 07:57 | #5

    @noter
    I tried this package, but it wouldn’t install the context menu item “Edit with Vim” in Windows 7 x64

  6. Seth
    September 27th, 2009 at 14:14 | #6

    And another thank you!

  7. Alkor Arman
    November 7th, 2009 at 17:45 | #7

    Thank-you very much! I really misssed this after installing Windows 7. I can’t edit without vi.

  8. Nate
    November 16th, 2009 at 07:11 | #8

    Anyway to get back the select two items and right-click so you get ‘Diff with Vim’?

  9. November 16th, 2009 at 08:45 | #9

    @Nate
    I use a program called ExamDiff (just google it) for the diff functionality, but it’s a couple of extra clicks because I use it through the Send To Menu. Basically the program is is an executable file you can put anywhere. I put it in C:\ root, then I create a shortcut to ExamDiff.exe in my Send To folder (C:\Users\\AppData\roaming\microsoft\windows\SendTo). Now I can simply select two files, right-click->Send To->ExamDiff and voila I have the two files in ExamDiff highlighting the differences btw. the two. I’ll look at the VIM Diff functionality as a weekend project when I’m done with finals :)

  10. Joe Zamora
    November 16th, 2009 at 13:59 | #10

    Don’t forget the icon!

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\Edit with Vim]
    “icon”=”C:\\Program Files (x86)\\Vim\\vim72\\gvim.exe”

    [HKEY_CLASSES_ROOT\*\shell\Edit with Vim\command]
    @=”C:\\Program Files (x86)\\Vim\\vim72\\gvim.exe \”%1\”"

  11. November 23rd, 2009 at 23:49 | #11

    This was really, really helpful. Thank you so much!

  12. Bill H
    December 11th, 2009 at 07:08 | #12

    Thanks for the fix. I was really starting to miss my “Edit With Vim…” entry!

  13. AndreasK
    December 17th, 2009 at 12:21 | #13

    Hi,

    klasse, das habe ich bei Win7 vermisst, danke für die .reg Datei !

    Lieben Gruss
    Andreas

  14. MikeM
    December 29th, 2009 at 22:30 | #14

    merci beaucoup!

  15. Bob
    December 30th, 2009 at 09:11 | #15

    I can’t seem to get the 64bit version of gvim (from Google Code) working even after modifying for ‘Program Files’ instead of ‘Program Files (x86)’. Getting error:

    “This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel.”

    And FWIW I think the registry setting in the article is missing a trailing doublequote.

  16. December 30th, 2009 at 11:42 | #16

    @Bob
    Bob,

    This article uses the 32bit version of gVim, not the 64bit version. I couldn’t get that to work either. The article illustrates how to get the context menu “edit with gVim” entry to work after installing the 32bit version of gVim on Windows 7 x64. The issue is that in Windows 7 the context menu change isn’t applied during the installation of the program.

    As far as the registry change goes, I exported it from my registry so I think the quotes are correct, however, please note the disclaimer whenever making changes to your computer.

    Cheers,
    David

  17. Bob
    January 2nd, 2010 at 13:18 | #17

    @David

    Good to know, thanks. I had no idea how much I relied on the “Edit with Vim” til I switched to a Win7 machine.

  18. Bob
    January 2nd, 2010 at 13:36 | #18

    One last note – this is likely obvious to many but – while I was resigning myself to having to use SendTo I noticed that …\AppData… is a hidden folder in Win7. You’ll probably have to use “Organize”/”Folder and Search Options”/”View”/”Show hidden” to make it visible.

  19. CJ Gaconnet
    January 13th, 2010 at 11:09 | #19

    I thank you tremendously.

  20. tsohr
    January 18th, 2010 at 22:22 | #20

    Thanks!! :)

  21. martin
    January 26th, 2010 at 13:39 | #21

    thanks but the 64bit version works on my pc :D

  1. October 17th, 2009 at 01:38 | #1

Switch to our mobile site