This is an updated version of the file ftplugin/tex.vim included in the
standard vim distribution. It sets options appropriately for editing TeX
(especially LaTeX) files. It is fairly conservative: it may not do everything
you want, but it will probably not do anything to annoy you.

This will set the buffer-local variable b:tex_flavor to "tex" (for plain TeX)
or "latex". Other mappings, plugins, etc. may use this variable to modify
their behavior.

install details

Copy the file to $VIMRUNTIME/ftplugin/tex.vim .
You probably do not want to have this in your local ftplugin/ directory,
since you may get an even more recent version when you upgrade to
a new version of vim.