2. Vim Packaging

Here you can find a brief overview of how the Vim editor is packaged in Debian and a few concepts useful later; if you are just interested in the guidelines for packaging addons skip to Section 3.

The Vim editor is split in Debian as several binary packages. The key splitting is according to variants, a Vim variant is a particular version of the /usr/bin/vim executable built with a given set of (configure) option. Examples of variants provided in Debian are: vim-tiny, vim, vim-nox, vim-gtk3. Have a look at their full descriptions for their characteristics. The actual /usr/bin/vim file is managed via the alternative mechanism and point to one of the variants.

Another relevant binary package is vim-runtime which ships the Vim runtime environment distributed upstream together with the editor. Almost all third party extensions to Vim come as additional pieces of this runtime environment, how to package them is the main topic of this document.

To be working properly extensions should be located somewhere where Vim can find them. This "somewhere" is expressed in Vim as a list of directories to be looked for in turn when looking for extensions. Such a list is the Vim runtime path, and is kept in the Vim global variable runtimepath; you can inspect it executing :set runtimepath? inside Vim. See :help 'runtimepath' in the Vim online help for more information, including the relevant subdirectories which Vim will look for inside each component of the runtime path.

Vim also has a concept of packages. A package must follow a specific directory structure and be located in one of the directories defined in the packpath option. Within each package, there are two relevant directories:

start

All addons in this directory will automatically be added to runtimepath and loaded like any other addon that comes with Vim. These are called automatic addons.

opt

Any addons in this directory must explicitly be enabled by executing :packadd! ADDON in the user's vimrc. These are called optional addons.