On Sat, Aug 26, 2006 at 01:38:11AM +0200, Stefano Zacchiroli wrote: > [ Forwarded to vim-dev, as requested by Bram. Consider both the patch > and the suggested default change as RFCs ] > > Hi Bram, > could you please consider the attached patch for filetype.vim? It > provides better recognition of 'tex' filetypes against 'plaintex' ones. > It looks for sectioning commands that are specific to latex (\part, > \section, \paragraph, ...). > > Also, according to a comment in filetype.vim, the code distinguishing > between 'tex' and 'plaintex' should default to 'tex', whereas, according > to these lines: > > " Default value, may be changed later: > let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' > > I assume it defaults to 'plaintex'. Is there a reason for that or it is > just a typo? I found the default to 'tex' much more reasonable, as most > of people write latex these days ... > > What about changing it so that it matches the comment? > > Many thanks in advance, > Cheers.
I believe that Bram does not use any version of TeX himself. I maintain the plaintex and latex ftplugins, and I suggested the current detection scheme (after a RFC before vim 7.0 was released). If the comments, documentation, and code do not agree, it is probably my fault. I do not think there is any reliable way to distinguish between plain TeX and LaTeX. After my RFC, I decided to treat plain TeX as the default, since it is the more basic, even though I agree that LaTeX is probably far more common now. I suggest adding let tex_flavor = "latex" to your vimrc file. HTH --Benji Fisher