Vim Tips Wiki
Advertisement
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 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.

  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. See :help $VIM and :help $VIMRUNTIME if you want to know how this works (and potential pitfalls).

References[]

Comments[]

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

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


Advertisement