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 vim72 for version 7.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, or if you don't use an installer (for example if you compile Vim yourself, 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\
Now put the runtime files and executables in place. You can get these files by copying from the default install location, or you can get the Vim source code and runtime files from Mercurial and compile the executables yourself.
- Put gvim.exe and/or vim.exe, vimrun.exe, xxd.exe, gvimext.dll into vim\
- Put all the remaining .vim, .txt, and other non-executable files that are distributed under vim\vimxy\ in to vim\runtime\
- 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.
- Put your _vimrc and _gvimrc files in vim\ with the executables.
- 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.
- 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.
- You are all done. $VIM and $VIMRUNTIME will be set automatically for you. They will point to vim\ and vim\runtime\ respectively. See :help $VIM and :help $VIMRUNTIME if you want to know how this works (and potential pitfalls).
Maybe–on w2k or newer–you should better use a junction point here.