If the first line of a *.tex file has the form
%&<format>
then this determined the file type: plaintex (for plain TeX), context (for ConTeXt), or tex (for LaTeX).
Otherwise, the file is searched for keywords to choose context or tex. If > no keywords are found, it defaults to plaintex. You can change the default by defining the variableg:tex_flavor
to the format (not the file type) you use most. Use one of these:
let g:tex_flavor = "plain"
let g:tex_flavor = "context"
let g:tex_flavor = "latex"
If I open a file from the terminal using vim t.tex
then run
:set ft?
It returns
filetype=plaintex
This should be filetype=latex
shouldn't it?
If I open a previous document (that was written in TexMaker) within vim and run :set ft?
it returns filetype=tex
. hmm.
I have added let g:tex_flavour = "latex"
to my vimrc, but this doesn't seem to make a difference.
I'm not sure what's best here, and what should be the prefered option. I appreciate that the question perhaps part LaTeX part Vim, but the issues I'm having aren't related to LaTeX afaik.