vimtex warning: Can't use callbacks with empty v:servername

Created on 14 Apr 2017  路  7Comments  路  Source: lervag/vimtex

When I open new .tex files, I get this warning: vimtex warning: Can't use callbacks with empty v:servername. How can I disable it?

Most helpful comment

This warning appears if you try to compile and the callback feature is enabled, but v:servername is not set. This occurs if you run vim in a terminal without the --servername NAME option.

You need to either:

  1. Disable the callback feature with e.g. let g:vimtex_compiler_latexmk = {'callback' : 0}, or
  2. Start vim with the servername option, or
  3. Use gui vim (gvim).

All 7 comments

After updating vimtex plugin, I get the same error when I run compile command (i.e., \ll).

This warning appears if you try to compile and the callback feature is enabled, but v:servername is not set. This occurs if you run vim in a terminal without the --servername NAME option.

You need to either:

  1. Disable the callback feature with e.g. let g:vimtex_compiler_latexmk = {'callback' : 0}, or
  2. Start vim with the servername option, or
  3. Use gui vim (gvim).

Read more about this:

  • :help g:vimtex_compiler_latexmk
  • :help vimtex-requirements (section about the clientserver)
  • :help clientserver

@lervag, Clarification question: Does disabling callback with {'callback': 0} disable the "callback" you get from a job exiting created with job_start? When I use vimtex, it seems that it is possible to have background compilation _without_ client-server using jobs .. although the documentation suggests otherwise.

Disabling callback disables the latexmk callbacks after failed/successful compilations. It has nothing to do with the job_start callback feature.

You can have background "single-shot" compilation with an exit callback from job_start that will check for errors after compilation. This should work regardless of the clientserver and v:servername, but obv. requires Vim 8.

Thus: The confusion is that there are two types of callbacks. The ones from the Vim job handler, and the ones from latexmk. The callback option refers to the latexmk callbacks, not the Vim job handler.

Thanks for the explanation!

No problem :)

Was this page helpful?
0 / 5 - 0 ratings