Wikia

Vim Tips Wiki

Version independent installation of Vim on Windows

Talk0
1,613pages on
this wiki
Revision as of 10:13, April 12, 2009 by JohnBot (Talk | contribs)

Tip 714 Printable Monobook Previous Next

created May 10, 2004 · complexity intermediate · author Baukje Miedema · version 5.7


The installer and the zip versions of the (g)vim distributions for MS-Windows install (g)vim in a directory hierarchy rooted at vim\vimxy\ where xy in the directory name is the version number. For example, vimxy would be vim62 for version 6.2. This setup means that the location of (g)vim.exe is different for every version. This setup makes good sense if you maintain several versions of vim on your computer. However, if you only keep one version of (g)vim at a time, it can be convenient to always have it in the same location. The following shows you one way to achieve this.

Set up a directory hierarchy as follows

vim\
vim\runtime\
vim\runtime\syntax\
vim\runtime\plugin\
vim\runtime\ftplugin\
vim\runtime\indent\
vim\runtime\doc\
vim\runtime\colors\
vim\runtime\compiler\
vim\runtime\macros\
vim\runtime\tools\
vim\runtime\tutor\
vim\vimfiles\
vim\vimfiles\syntax\
vim\vimfiles\plugin\
vim\vimfiles\ftplugin\
vim\vimfiles\indent\
vim\vimfiles\doc\
vim\vimfiles\colors\
vim\vimfiles\compiler\

1. Put gvim.exe and/or vim.exe, vimrun.exe, xxd.exe, gvimext.dll into vim\

2. Put all the remaining .vim, .txt, and other non-executable files that are distributed under vim\vimxy\ in to vim\runtime\

3. Put the contents of the distributed vim\vimxy\plugin\ in to vim\runtime\plugin\ and so on for all the other subdirectories of vim\vimxy\ including syntax, ftplugin, indent, doc, colors, compiler, macros, tools, tutor.

4. Put your _vimrc and _gvimrc files in vim\ with the executables.

5. Either ensure that vim\ is in your path, or create shortcuts and/or batch (bat or cmd) files that can start vim\(g)vim.exe for you.

6. If you have downloaded any scripts from vim.sf.net or elsewhere, put them in the appropriate spot in the vim\vimfiles\ hierarchy where they stay separate from the official distribution files in vim\runtime\. In this way, when you upgrade (g)vim to a newer version, you will not have to copy, move or do anything with these extra files. For example, plugins from vim.sf.net go into vim\vimfiles\plugin\ and color scheme files go into vim\vimfiles\colors\ etc.

7. You are all done. $VIM and $VIMRUNTIME will be set automatically for you. They will point to vim\ and vim\runtime\ respectively.

Comments

It is generally not a good idea to mis-match runtime files and executable/program as suggested above. Vim's default installer automatically updates shortcuts, desktop icons, context menus, registry entries, and command line batch files.

Rather than contorting the default installation as suggested, simply update your custom batch files to point to the new installation location!


You may not like this scheme but there is no talk of mismatching runtime and executable files -- just changing their location.


Maybe - on w2k or newer - you should better use a junction point here.

See: "http://forums.mozillazine.org/viewtopic.php?t=34490";


This scheme also fits very well if you compile your own patched gvim for Windows from the UNIX sources.


Around Wikia's network

Random Wiki