Question about 3rd-party packaging of Vim syntax highlighting
macros
James Vega
jamessan at debian.org
Fri Feb 9 20:37:38 UTC 2007
On Fri, Feb 09, 2007 at 11:56:54AM -0800, Kevin B. McCarty wrote:
> Attached please find the files "syntax-kuip.vim" which I am trying to
> install to /usr/share/vim/addons/syntax/kuip.vim and "ftplugin-kuip.vim"
> which I am trying to install to /usr/share/vim/addons/ftplugin/kuip.vim
>
> When I do put them in those locations, Vim doesn't recognize that for a
> file with name ending in .cdf, it should load the kuip syntax. However
> if I explicitly tell it ":set syntax=kuip" it does load the highlighting
> correctly, with the caveat at [*] below. So it appears that Vim finds
> the syntax file automatically but perhaps not the ftplugin file.
Vim has to be told how to determine what filetype a certain file is.
The easiest way for you to do this would probably be to ship
/usr/share/vim/addons/ftdetect/kuip.vim with the contents:
au BufRead,BufNewFile *.cdf set filetype=kuip
This, of course, assumes that *.cdf is predominantly going to be of kuip
filetype.
> I tried adding a file at /usr/share/vim/registry/cernlib-base.yaml
> listing the above two files, in the same format as the .yaml file
> provided by vim-latexsuite, but that didn't seem to change anything. How
> should I be doing this?
For syntax, indent, and ftplugin files, I'd say it's safe to ship the
files in /usr/share/vim/addons. The purpose for the registry is more
geared towards plugins since they're always loaded instead of only being
loaded for a specific filetype.
> [*] Finally, one more minor question. In some cases CDF files include a
> block of C syntax. In "syntax/kuip.vim", line 51, I try to load this via:
>
> syn include @kuipC <sfile>:p:h/c.vim
>
> as recommended in the Vim help documentation. This would work if
> kuip.vim was installed to the same place as c.vim, in
> /usr/share/vim/vim70/syntax/; but since kuip.vim is instead in
> .../addons/syntax/, it doesn't work. I suppose I could do one of these
> instead:
Vim's help goes on to note that when the filename is a relative path, it
will be searched for in Vim's runtime directories. Following that, you
should be able to use:
syn include @kuipC syntax/c.vim
Hope that helps.
James
--
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20070209/c0b93e7c/attachment.pgp
More information about the pkg-vim-maintainers
mailing list