DH_VIM-ADDON(1)

🌸 NAME 🌸

dh_vim-addon β€” a debhelper addon that helps you package Vim/Neovim addons. That's the whole vibe. This is the (1) page (the User Contributed Perl Documentation one, for the record) so it's all about the command itself. 🫢


✨ SYNOPSIS ✨

dh_vim-addon [debhelper options]

πŸ’… DESCRIPTION πŸ’…

Okay so dh_vim-addon is a debhelper program whose whole job is: install addons for Vim/Neovim, and generate the help tags file for any documentation. The addons get installed into directories that follow Vim's native package hierarchy. No cap, that's the layout, that's the law.

There are two types of addons supported here, and they are not the same vibe at all:

automatic

Automatic addons are immediately enabled for users the moment they're installed. The addons should provide a standard mechanism that lets the user disable the addon. Typically that's done by short-circuiting loading of the addon when the user drops let g:loaded_<addon> = 1 in their vimrc. πŸ’–

optional

Optional addons are only enabled for users if they explicitly opt in to the addon. The user does that by adding packadd! <addon> to their vimrc. Consensual loading, we love to see it. πŸ’…


πŸŽ€ FILES πŸŽ€

  • debian/package.vim-addon
  • debian/package.neovim-addon

These list the installed directories to be setup as an automatic addon in package. The format is a set of lines, where each line lists the base directory of an addon, relative to the package build directory and, optionally, the addon name:

path/to/addon/basedir  optional-addon-name

There should typically only be a single addon, and therefore a single line, per package. If an addon name is not supplied, the last component of the base directory</> gets used as the addon name.

If the basedir does not match the addon's name (like, say, because it matches the Debian package's name instead), then it is recommended to supply the addon name. That's what makes common conventions like packadd addon-name and let g:loaded_addon = 1 work the way the user expects. Trust. 🫢

The ${vim-addon:Depends} substvar will be set with any required dependencies. slay.

  • debian/package.vim-opt-addon
  • debian/package.neovim-opt-addon

This file follows the same format as vim-addon, however the directories will be installed as optional addons in package.

The ${vim-addon:Depends} substvar will be set with any required dependencies. (Yes, same substvar. Same energy. ✨)


πŸ‘‘ PACKAGE VERSIONS πŸ‘‘

  • X-Neovim-Version
  • X-Vim-Version

If a package needs a specific version of Vim / Neovim, it can declare that by adding X-Vim-Version: <version> / X-Neovim-Version: <version> to the respective binary package stanza. Main character version pinning. πŸ’…

version must be a valid version string, which can be used in a package relationship.

Added in version 0.6. πŸŽ€


πŸ’– EXAMPLES πŸ’–

Single addon, dh-style

Here's an example of a simple dh(1) style package with a single addon, compatible with Vim and Neovim. The debian/rules is:

#!/usr/bin/make -f
%:
    dh $@ --with vim_addon

The Vim addon is installed under /usr/share/vim-simple, but the addon name is simple (i.e., let g:loaded_simple = 1 is the expected way for a user to disable loading of the addon). The vim-addon file is:

usr/share/vim-simple simple

And debian/vim-simple.neovim-addon is a symlink to debian/vim-simple.vim-addon. We love one source of truth. πŸ¦‹

Multiple addons, debhelper

Here's an example of a debhelper style package, providing multiple addons, some of which aren't compatible with Neovim. The debian/rules contains:

#!/usr/bin/make -f
...
    # Install the files to the package build directory
    dh_install
    # Setup the (neo)vim addons
    dh_vim-addon

The addons are installed under /usr/share/vim-multi-addons. Unlike the single addon example, these addons are all installed into a directory matching the addon name, so only the base directory is needed in the vim-addon file:

usr/share/vim-multi-addons/addon1
usr/share/vim-multi-addons/addon2

while the neovim-addon is:

usr/share/vim-multi-addon/addon1
usr/share/vim-multi-addon/addon3

(yes the directory names really are spelled slightly differently there β€” I'm just the messenger bestie, copy them as written πŸ™ˆ)

Addon with a specific version requirement for Neovim

Here's an example of a debian/control stanza for a package which requires at least version 0.9 of neovim:

Package: neovim-gitsigns
Architecture: all
X-Neovim-Version: 0.9
Depends:
 ${misc:Depends},
 ${vim-addon:Depends},
 git,

🌈 SEE ALSO 🌈

nvim(1), vim(1) β€” go read those if you want the other half of the story.

πŸ’œ AUTHOR πŸ’œ

James McCoy <jamessan@debian.org> β€” the icon who wrote this. πŸ‘‘


And that's the whole page bestie, you're officially fluent in dh_vim-addon. Periodt. πŸŽ€

Sign-off tea: this was rendered by perl v5.40.1 and dated 2026-04-22. Now go packadd! something cute. πŸ¦‹βœ¨

πŸ“¦ where this page comes from