I have recently setup vimtex and YCM as the associated autocompleter. These work great in their intended scenario, however I believe the autocompleter is giving suggestions when I am typing plain text and I want to avoid that. It is causing some lag and I want to get rid of them.

Is there any way to set up vimtex with YCM so that I do not get suggestions when typing plain text?

To clarify I want to configure YCM (if possible) so that in a *.tex file:

  1. I do not have autocomplete popups for plain text.
  2. I would only like popups for LaTeX specific syntax to appear, e.g, commands, environments, labels, etc.

1 Answer 1


From :help YCM

YCM has a g:ycm_filetype_blacklist option that lists filetypes for which
YCM shouldn't be turned on. YCM will work only in filetypes that both the
whitelist and the blacklist allow (the blacklist "allows" a filetype by _not_
having it as a key).

My blacklist (in my .vimrc) looks like this, and YCM isn't triggered for plaintext files:

let g:ycm_filetype_blacklist = {
            \ 'tagbar': 1,
            \ 'notes': 1,
            \ 'netrw': 1,
            \ 'unite': 1,
            \ 'text': 1,
            \ 'vimwiki': 1,
            \ 'pandoc': 1,
            \ 'infolog': 1,
            \ 'leaderf': 1,
            \ 'mail': 1
  • I think the OP means typing text in LaTeX documents that is not supposed to be completed. But who knows... :p Commented Apr 27, 2021 at 7:06
  • As @KarlYngveLervåg has indicated, I am trying to stop autocompletion of text in LaTeX documents. Commented Apr 27, 2021 at 7:07
  • @Zeta-Squared I suggest you update your question to make this clear. Note: this is not really a question on how to setup VimTeX, but on how to set up YCM. VimTeX does not have any autocomplete features, YCM do. So the lag you are discussing is due to YCM, and you will need to properly configure YCM. Unfortunately, I don't know much more about YCM than what's in the VimTeX docs. Commented Apr 27, 2021 at 7:10
  • oh I see - in that case does the above work if you add a line to blacklist 'tex' files?
    – mattb
    Commented Apr 27, 2021 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.