# Vim syntax highlighting of partial tex file used with \include is incorrect

I am using vim to edit latex files. The document is long and so I split each chapter in its own .tex file. Each .tex file is then included into the main document using the \include directive.

The main problem is that when edited the separate .tex files, the syntax highlighting is incorrect. The main tex file which includes all the chapters is correctly highlighted because it contains the preamble and \begin{document} ... \end{document, but since the partial files do not include those statements it is highlighted incorrectly.

Do anyone know of a quick fix for this?

You can add the following line to your .vimrc file in order to tell vim always to expect LaTeX code (instead of plain TeX code) within .tex files:
let g:tex_flavor = "latex"