Bug#169716: vim: *.cls to filetype mapping needs extension

Bram Moolenaar Bram Moolenaar <Bram@moolenaar.net>, 169716@bugs.debian.org
Tue, 17 May 2005 16:32:32 +0200


Stefano -

> > *.cls are recognized as smalltalk files by vim. They are also LaTeX
> > class files. In most cases, LaTeX class files start with the first
> > line =3D~ '^%%', so maybe the following in $VIMRUNTIME/scripts.vim will
> > work:
> >
> >   elseif s:line1 =3D~ '^%%'
> >     set ft=3Dtex
> 
> Attached you will find the patch I applied to the debian package which
> fixes this behaviour. I set ft=3Dtex if just one '%' is found since many
> third part classes (e.g. LNCS, ENTCS) starts in such a way.
> 
> Of course the patch is now for /usr/share/vim/vim63/filetype.vim.
> 
> Bram, could you please consider including the attached patch to future
> vim versions?

Looks fine to me.  I'll include it.

- Bram

-- 
Save the plankton - eat a whale.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///