tags 169716 + pending patch
forwarded 169716 [EMAIL PROTECTED]
thanks

> *.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 =~ '^%%', so maybe the following in $VIMRUNTIME/scripts.vim will
> work:
>
>   elseif s:line1 =~ '^%%'
>     set ft=tex

Attached you will find the patch I applied to the debian package which
fixes this behaviour. I set ft=tex 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?

Many thanks.
Cheers.

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
[EMAIL PROTECTED],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. -!-
diff -urN vim63/runtime/filetype.vim vim63.new/runtime/filetype.vim
--- vim63/runtime/filetype.vim  2005-05-08 17:01:08.000000000 +0200
+++ vim63.new/runtime/filetype.vim      2005-05-08 16:57:42.000000000 +0200
@@ -1363,8 +1363,14 @@
 au BufNewFile,BufRead .slrnrc                  setf slrnrc
 au BufNewFile,BufRead *.score                  setf slrnsc
 
-" Smalltalk
-au BufNewFile,BufRead *.st,*.cls               setf st
+" Smalltalk (or TeX class)
+au BufNewFile,BufRead *.st                     setf st
+au BufNewFile,BufRead *.cls
+       \ if getline(1) =~ '^%' |
+       \   setf tex |
+       \ else |
+       \   setf st |
+       \ endif
 
 " Smarty templates
 au BufNewFile,BufRead *.tpl                    setf smarty

Attachment: signature.asc
Description: Digital signature

Reply via email to