Vim Tips Wiki
m (Version independent installation of (g)vim on MS-Windows moved to Version independent installation of Vim on Windows: Page moved by JohnBot to improve title)
(clean up...this is a good tip, which I will certainly use when compiling Vim myself)
Tag: rollback
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
  +
{{TipImported
{{review}}
 
{{Tip
 
 
|id=714
 
|id=714
  +
|previous=713
|title=Version independent installation of (g)vim on MS-Windows
 
  +
|next=716
|created=May 10, 2004 6:36
+
|created=May 10, 2004
 
|complexity=intermediate
 
|complexity=intermediate
 
|author=Baukje Miedema
 
|author=Baukje Miedema
 
|version=5.7
 
|version=5.7
 
|rating=15/16
 
|rating=15/16
  +
|category1=Building Vim
|text=
 
  +
|category2=
Version independent installation of (g)vim on MS-Windows
 
 
}}
  +
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 [[:Category:Building Vim|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:
   
  +
<pre>
 
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\
  +
</pre>
   
  +
Now put the runtime files and executables in place. You can get these files by copying from the default install location, or you can [[Getting_the_Vim_source_with_Mercurial|get the Vim source code and runtime files from Mercurial]] and compile the executables yourself.
The installer and the zip versions of the (g)vim distributions for
 
   
 
#Put gvim.exe and/or vim.exe, vimrun.exe, xxd.exe, gvimext.dll into vim\
MS-Windows install (g)vim in a directory hierarchy rooted at vim\vimxy\
 
 
#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).
   
  +
==References==
where xy in the directory name is the version number. For example, vimxy
 
  +
*{{help|$VIM}}
  +
*{{help|$VIMRUNTIME}}
  +
*{{help|'runtimepath'}}
   
 
==Comments==
would be vim62 for version 6.2. This setup means that the location of
 
   
 
Maybe&ndash;on w2k or newer&ndash;you should better use a junction point here.
(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!
 
 
 
'''Anonymous'''
 
, May 10, 2004 11:23
 
----
 
You may not like this scheme but there is no talk of mismatching runtime and executable files -- just changing their location.
 
 
'''Anonymous'''
 
, May 10, 2004 11:29
 
----
 
Maybe - on w2k or newer - you should better use a junction point here.
 
   
 
See: "http://forums.mozillazine.org/viewtopic.php?t=34490";
 
See: "http://forums.mozillazine.org/viewtopic.php?t=34490";
   
'''Anonymous'''
 
, May 11, 2004 2:40
 
----
 
This scheme also fits very well if you compile your own patched gvim for Windows from the UNIX sources.
 
 
'''Anonymous'''
 
, July 4, 2004 9:23
 
 
----
 
----
<!-- parsed by vimtips.py in 0.576170 seconds-->
 

Revision as of 20:17, 10 July 2010

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";