Adding Vim to MS-Windows File Explorer Menu
Talk0this wiki
When Vim is correctly installed on a Windows 32-bit system (for example, using the Vim without Cream distribution), you should see an "Edit with Vim" item in the right-click context menu in Windows Explorer. The same can be achieved on a Windows 64-bit system providing a 64-bit distribution is used (see I'm using 64-bit Windows). This tip shows how to repair or manually add the context menu on a 32-bit system.
Contents |
From tip 1068
Using gvim under Windows, if you move your Vim folder, you will find that "Edit with Vim" is missing from the context menu when you right click a file in Windows Explorer.
To fix, run regedit and set the following values to the correct paths:
[HKEY_LOCAL_MACHINE\SOFTWARE\Vim\Gvim]
path=C:\Program Files\vim\vim72\gvim.exe
[HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32]
(Default) = C:\Program Files\vim\vim72\gvimext.dll
Original tip
To add "Edit with Vim" to the Windows File Explorer context menu:
- Save this file as edit-with-vim.reg.
- Make sure the paths are right for your machine.
- Double click on it in Explorer to import this file.
- The double quotes are needed for filenames with spaces.
- The '*' means 'for all files'.
REGEDIT4 [HKEY_CLASSES_ROOT\*\shell\vim] @="Edit with &Vim" [HKEY_CLASSES_ROOT\*\shell\vim\command] @="c:\\bin32\\gvim.exe \"%1\""
See also
Comments
Why isn't GvimExt (gvimext.dll) used? When is GvimExt needed?
In Windows 7 x64 the 32-bit installer does not successfully add "Edit with Vim" to the right-click context menu. Here's how to do it manually in Windows x64:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Edit with Vim\command] @="C:\\Program Files (x86)\\Vim\\vim72\\gvim.exe \"%1\""
Using regedit to edit the registery, browse to HKEY_CLASSES_ROOT\*\shell, then create a new key ("folder") called "Edit with Vim" (without the quotes), and then create a new key ("folder") under that called "command" (without the quotes). In command, edit the "(Default)" value so it contains (exactly as shown, including the four quotes):
"C:\Program Files (x86)\Vim\vim72\gvim.exe" "%1"
Also the value of (Default) in the key ("folder") called "Edit with Vim" should be changed to "Edit with &Vim" (without quotes; <&> is needed to underline <V> to have a shortcut)
--- A easier way: start command line with administrative privilege and run 'gvim -register' to register the vim to explorer context menu.