Skip to content
Advertisement

Provide vim syntax highlighting system wide by debian package

I wrote a custom software using its own configuration files under /etc. The software is built in a Debian package and delivered by a custom repository.

In order to provide a nice syntax highlighting in vim I wrote all the necessary files to nicely highlight my own config files. If I place them under ~/.vim/syntax and add a line to ~/.vim/filetype.vim everything works fine.

Now my question is: How can I package my vim extension inside my Debian package so that during installation the vim syntax highlighting is installed system wide and not only for the installing user (root)?

Advertisement

Answer

As ChrisNbg pointed out there is a document called Packaging of Vim Addons.


imo it is ok if a package installs files into a folder exposed by another package on which it depends on. Actually it is quite commonly used, for example by software package which can be extended with plugins, like vim.

On Ubuntu, vim expects plugin packages to install their syntax files into /usr/share/vim/addons/syntax/.

The following command has been used to find this out:

dpkg -S vim | awk '/addons/syntax/&&!/vim-runtime/'

Note: The above command may show nothing if you don’t have plugin packages installed.

On my system the output was:

systemtap-common: /usr/share/vim/addons/syntax/stp.vim
python-jinja2: /usr/share/vim/addons/syntax/jinja.vim
apparmor-utils, systemtap-common, python-jinja2: /usr/share/vim/addons/syntax
apparmor-utils: /usr/share/vim/addons/syntax/apparmor.vim
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement