[RFC] handling of vim addons

Stefano Zacchiroli zack at debian.org
Tue May 9 01:11:58 UTC 2006


Here it goes ...

handling of vim add-ons
=======================

vim add-ons
-----------

with "add-on" I refer to every additional (set of) feature that can be added to
vim using its extension mechanisms (color schemes, syntaxes, indentation,
plugin, ...)

current issues
--------------

every vim add-on is currently installed in /usr/share/vim/addons/, directory
which is in the runtimepath. As a consequence every installed add-on is always
enabled. The only way to choose which ones to load is to override the
runtimepath so that /usr/share/vim/addons/ is not listed and manually load the
desired one

proposed solution
-----------------

keep on installing add-ons under /usr/share/vim/addons/ (no changes are needed
for all packages which ship add-ons), but remove this directory from the
runtimepath. Adds a directory /var/vim/addons/ to the runtimepath and implement
a flexible symlink mechanism (a-la /etc/init.d/) to selectively enable add-ons.

implementation
--------------

1 registry, 1 tool.

The registry keep track of all installed vim add-ons, associating to each add-on
name a list of files that should be in the runtimepath to enable the add-on.
E.g., an entry in the registry can be:

  Add-on: utl
  Files: doc/utl_usr.txt, doc/utl_ref.txt, plugin/utl_rc.vim, plugin/utl.vim,
   plugin/utl_scm.vim, plugin/utl_arr.vim, plugin/utl_uri.vim

A single package can ship more than one add-on. Still, it is recommended that
each package named vim-<name> installs a single add-on called <name> so that its
easier for the user to know the canonical name of add-ons.

The tool 'vim-addons' enables/disables plugins (in the same spirit as
apache-modconf does for apache modules).

When invoked as 'vim-addons update' (by sysadms), it reads as input
/etc/vim/addons which lists names of enables add-ons, one per line. After
invoking it, the symlinks under /var/vim/addons/ are all and only those
corresponding to the addons listed /etc/vim/addons. This kind of invocation is
idempotent.

Other 'vim-addons' actions are meant to be used both by sysadms and users.
Besides providing some query mechanisms (e.g. 'vim-addons list'), 'vim-addons'
can be invoked to either "enable" or "enable" add-ons. When invoked by the
sysadm to enable/disable add-ons it basically change /etc/vim/addons and re-run
'update-vim-addons' (the actual implementation can be smarter than that and only
change the needed symlinks). When invoked by the user it enables/disables
add-ons acting on symlinks in the user directory ~/.vim/

registry format
---------------

the registry can be as simple as a set of files installed under
/usr/share/vim/registry/. We can think about providing a debhelper that looks
for all files installed under /usr/share/vim/addons/ and create the
corresponding registry entry installing it in the package or something similar.

miscellanea
-----------

* Automatic enabling of fresh installed add-on

  It is a debian de-facto policy that installing a package just "makes it work".
  To implement this, postinst scripts of vim addons should invoke 'vim-addons
  enable <name>'

* Disabling a system-wide enabled plugin

  In order to support users willing to disable in their configuration add-ons
  which are system-wide enabled an extra field could be added to the registry
  listing a line that need to be added to ~/.vimrc to disable an add-on (e.g.
  'let did_something = 1'). When invoked by users to disable a plugin such a
  line will be added to some file automatically sourced by vim on startup.

Cheers.

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20060508/a5e19990/attachment.pgp


More information about the pkg-vim-maintainers mailing list