Vim Tips Wiki

Changes: Vim On Vista


Back to page

(Comments: todo - list points to bear in mind when cleaning up)
Line 135: Line 135:
*We really need to delete the dodgy stuff from this page. Please add any comments below.
*Is there any useful information below the "AND IGNORE THE STUFF BELOW" line?
*[ Edit on 2008-11-24] added the "IGNORE" line, and the material at the top of the tip.
*[ Edit on 2008-12-30] added the "Vista 64" section, also above the "IGNORE" line.
*See discussion on [[User_talk:Snigdinna|Snigdinna's talk page]].
--[[User:JohnBeckett|JohnBeckett]] 01:38, 3 January 2009 (UTC)

Revision as of 01:38, January 3, 2009

Tip 1542 Printable Monobook Previous Next

created December 21, 2007 · complexity basic · author Fuzzymonk · version 7.0

This is no problem if you install Vim 7.2 or later.

To get "Edit with Vim" context menu for Vista, do this
a) download LATEST version of Vim from SourceForge : gvim-7-2-42.exe
b) Run the installer, accepting the license agreement
c) on Choose Components screen, expand "Icons, Menus and Shortcuts" tree
d) check the box for "Add Contextual Menu"
e) Finish the install.

NOTE: The above still won't work on Win64. However, it does work with the 64-bit binaries that can be found here.

Vista 64 - adding edit with VIm manually.

After installing VIm 7.2 I found I still didn't have the "Edit with VIm" option on my contextual menu. After some rooting around online and in the registry here is what I used to resolve the issue manually. This will allow you to edit any file you right click on with VIm, which I find useful. If you are uncomfortable editing your registry, please do not try using this method!

  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!

Yes, this is for the 32-bit binaries on 64-bit vista. (it's what available from

Snigdinna 19:26, 30 December 2008 (UTC)


Download and Install

Download and Install gVim 7.1(I used the one from [1])

  • changed the install dir to C:\vim to get around some odd things with UAC.
  • I prefer to have my vimfiles in my home directory, so I choose that option from the installer.
    • I also recommend setting the hidden attribute on the vimfiles folder so it does not visually clutter up the my home directory (Right click -> properties -> General Tab -> Check Hidden).

Copy the following files into C:\vim\vim71\

  • iconv.dll (from here You can find the dll file in the bin directory of the "libiconv-win32" archive.)
  • libintl.dll (from here Get "intl.dll" from the bin directory in the gettext-win32 archive and store it as "libintl.dll" in the same directory as gvim.exe, overwriting the file that may already be there.)
  • gvimext.dll (from script#1720)

Configure around Vista

If you want the "Edit with vim" Shell Extension in Windows Explorer:

  • Run C:\vim\vim71\install.exe
  • Choose no when asked if you want to uninstall, then enter "d 14"


Shell Extension

If you get a gvim not in your path error with the "Edit with vim" shell ext, make sure you do not have gvim.exe set to run as Administrator, as that will break it. To check this, right-click on gvim.exe, select 'Properties', then the 'Compatibility' tab. Make sure 'Run this program as administrator' is unchecked, then click on 'Show settings for all users' and again make sure 'Run this program as administrator' is unchecked.

File Association

Here is the thing that stuck me for hours, if you had previously installed Vim to a diffrent location you won't be able to associate files with the new location unless you edit the registry. Go to:


Make sure the edit\command and open\command Keys have the following default value:

C:\vim\vim71\gvim.exe "%1"


Windows Vista and newer creates a VirtualStore under %USERPROFILE% (often ~ in Vim) to support applications that attempt to open protected files for writing when the user doesn't have permissions. Under User Account Control (UAC), this even applies to administrators who are not running from an elevated shell.

This can lead to problems when you make any modifications under $VIM that might be installed to a protected location, such as %ProgramFiles% as it is by default. To make sure Vim doesn't keep using any files written to the VirtualStore after making modifications under $VIM, delete the VirtualStore for Vim by doing the following from a console shell.

rmdir /q /s "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\Vim"

Restart Vim.

Notes No explanation has been provided for why the above suggestion about deleting a directory tree would be desirable or safe. Also, no example of a problem that can occur is available. It would be useful to document how modifications under $VIM may occur, and the effect of deleting the VirtualStore files.


Several people have reported that they had no problem installing and using Vim on Vista. The users concerned did not perform any of the steps from this tip.

Consequently, it may be better to delete this tip unless some further explanations are available as to why the recommended procedures would be helpful.

There is no known reason to take the steps recommended in the "Download and Install" section of this tip. It is always dodgy to mix files from various sources, particularly if no reason for doing so is given.

In the original tip, the author stated that the version of Vim was downloaded from It is always possible that the particular build of Vim had a problem. In that case, the problems presented in this tip would not be applicable to other users, and in fact might be dangerous because some fairly radical manipulations are recommended.

Please add any comments below (after a line consisting of ---- to create a horizontal rule).

From the new tips discussion:

I didn't realize that everything was working that well on other machines. I do think there is value in keeping two of the sections:

  • The information on how to fix the shell extension if Vista thinks Vim needs to be run as administrator.
  • The file association fix.

Where would you recommend putting these? Or are they too edge case for the wiki?

--Fuzzymonk 16:27, 14 January 2008 (UTC)

Sorry to have not responded sooner – there has been a lot going on. I decided to just put a "to do" comment where required in the new tips, and leave it for sorting out later. If you want to pursue your suggestion, please just edit the tip here. I think any information regarding Vim on Vista should be in this tip. I don't know what to keep (Vista is outside my experience). I'm hoping to attract comments from Vista users. --JohnBeckett 04:02, 19 February 2008 (UTC)

The problem I was having was that it couldn't copy the .bat files to the Windows directory. Running install.exe as Administrator solved this problem.

I tried a few methods on this page to no avail.

The context menu stuff is not working. Tried with gvim-7-2-68.exe under Vista Home Premium 64 as Administrator.


  • We really need to delete the dodgy stuff from this page. Please add any comments below.
  • Is there any useful information below the "AND IGNORE THE STUFF BELOW" line?
  • Edit on 2008-11-24 added the "IGNORE" line, and the material at the top of the tip.
  • Edit on 2008-12-30 added the "Vista 64" section, also above the "IGNORE" line.
  • See discussion on Snigdinna's talk page.

--JohnBeckett 01:38, 3 January 2009 (UTC)

Around Wikia's network

Random Wiki