How can a package install additional syntax files ?

James Vega jamessan at
Sun Oct 25 19:13:56 UTC 2009

On Sat, Oct 24, 2009 at 06:16:42PM +0200, أحمد المحمودي wrote:
>   The README included with the tarball says to install the syntax files 
>   in ~/.vim/syntax/ & the ftplugin script in ~/.vim/ftdetect/

Either their documentation is wrong or there's some confusion.  An
ftplugin script is a plugin, providing functionality other than syntax
or indentation, that is only used for a specific filetype.  An ftdetect
script gives Vim additional information for determining which filetype
to use for a specific file.

>   Yet I am thinking of installing those scripts system wide, so I have a 
>   couple of questions:

The preferred method is laid out in the Vim Addon Policy[0].  Although
it's talking about making a package specifically for a Vim addon, it
applies equally to other packages which ship Vim scripts.

>   1. How to do so ? I found in /usr/share/vim/ that there is a symlink 
>   called 'vimcurrent' pointing to 'vim72'. So should I install to 
>   /usr/share/vim/vimcurrent/... ?

No, that path is reserved for the Vim packages.  Your files should
either be shipped under /usr/share/vim/addons or in a directory under

>   2. I don't see an 'ftdetect' in /usr/share/vim/vimcurrent/, but I 
>   there is an 'ftplugin' folder, should that filetype detection script 
>   be installed in 'ftplugin' ?

That's because upstream Vim simply has one ftdetect script
(filetype.vim) that is used instead of breaking it up into multiple
files in the ftdetect directory.  You can see more info about the
different ways (and the reasoning behind those ways) of adding filetype
detection in Vim's "new-filetype" help topic.

Vim will look for an ftdetect directory underneath all of the
directories listed in the 'runtimepath' option, though.  In Debian's
config, this includes the system-wide install path, the user's install
path, and the path managed by vim-addon-manager.

Hopefully that cleared some things up.

GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan at>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <>

More information about the pkg-vim-maintainers mailing list