Does YCM set the 'filetype'
option? If you want it set to tex
, then check where it was set:
:verbose set ft?
I bet it is set in $VIMRUNTIME/filetype.vim
, in which case it is my fault. Luckily, I made it configurable. According to :help ft-tex-plugin
,
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 variable g: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"
Currently no other formats are recognized.
I think that
:let g:tex_flavor = 'latex'
in your vimrc file will make you happy.