vimtex warning: Can't use callbacks without +clientserver

Created on 31 Jul 2016  路  11Comments  路  Source: lervag/vimtex

Explain the issue

Most issues are related to bugs or problems. In these cases, you should include
a minimal working example and a minimal vimrc file (see below), as well as:

  1. Steps to reproduce
  2. Expected behaviour
  3. Observed behaviour

If your issue is instead a feature request or anything else, please consider if
minimal examples and vimrc files might still be relevant.

Note: If you have any .latexmkrc file present, please include the content of
this as well.

Minimal working example

Please provide a minimal working LaTeX example, e.g.

\documentclass{minimal}
\begin{document}

Hello World!

\end{document}

Minimal vimrc file

Please provide a minimal vimrc file that reproduces the issue. The following
should often suffice:

set nocompatible

" Load Vimtex
let &rtp  = '~/.vim/bundle/vimtex,' . &rtp
let &rtp .= ',~/.vim/bundle/vimtex/after'

" Load other plugins, if necessary
" let &rtp = '~/path/to/other/plugin,' . &rtp

filetype plugin indent on
syntax enable

" Vimtex options go here

Most helpful comment

Sorry, you are right @wookayin. The disable_version_warning will only disable a warning that appears if you are using an old version of Vim.

The reason for removing the option is that I've generalized the compiler feature to allow other compilers, such as latexrun. If you do :help g:vimtex_latexmk_callback, you will see that there is a short entry in the changelog that should point you in the right direction. The corresponding option in the updated version is g:vimtex_compiler_latexmk, which is a dictionary that contains all latexmk related options. E.g., to turn off the latexmk callback feature:

let g:vimtex_compiler_latexmk = {'callback' : 0}

All 11 comments

Hello,
I use vimtex for a long time. After an update my vim plugins I get this error message:
vimtex warning: Can't use callbacks without +clientserver

I use Vim 7.4 and Centos 7

Yes. I've recently added more verbose warnings. You can turn off the warnings by setting g:vimtex_disable_version_warning to 1.

Note, though, that this warning implies that you don't get the callback feature, since it requires +clientserver. Thus vimtex can't provide a status message after background compilation, and it won't show errors automatically on failed compilation. This is not a necessary feature, of course, but it is (IMHO) quite useful.

The warning message comes from function! s:compiler.init_check_requirements() abort dict at autoload/vimtex/compiler/latexmk.vim, but g:vimtex_disable_version_warning is from autoload/vimtex.vim. So this flag has nothing to do with the +clientserver warning message.

Another note: The option g:vimtex_latexmk_callback has been deprecated and removed as of 2017-03-31. But why?

Sorry, you are right @wookayin. The disable_version_warning will only disable a warning that appears if you are using an old version of Vim.

The reason for removing the option is that I've generalized the compiler feature to allow other compilers, such as latexrun. If you do :help g:vimtex_latexmk_callback, you will see that there is a short entry in the changelog that should point you in the right direction. The corresponding option in the updated version is g:vimtex_compiler_latexmk, which is a dictionary that contains all latexmk related options. E.g., to turn off the latexmk callback feature:

let g:vimtex_compiler_latexmk = {'callback' : 0}

Thanks for your reply! I just missed the g:vimtex_compiler_latexmk part of the documentation.

No problem! :)

how could I fix above "vimtex warning: Can't use callbacks without +clientserver" problem? so that I could use background compilation feature.
thank you!

You need a Vim with +clientserver feature (check this with :echo has('clientserver'). Next, you need to start Vim with a servername. Gui vim (gvim) does this automatically, so does neovim. Vim in terminal needs the --servername NAME option. See :h clientserver for more info.

I am using VIM 8.0 on a Mac. I am getting the same error "Can't use callbacks without +clientserver". I am completely new to VimTex. The default version of vim I got on my Mac is compiled without clientserver option enabled. Is it safe to use let g:vimtex_compiler_latexmk = {'callback' : 0} without any loss of functionality?

I would assume that the problem is that you are running Vim in a terminal, in which case you need to use the option --servername VIM (or any other name) to start with servername. See :help vimtex-clientserver for more info. The clientserver is good, because it allows callbacks. Callbacks allow latexmk to communicate to vimtex that a compilation is finished and if it was successful or not.

If you still have problems, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

siemdejong picture siemdejong  路  5Comments

LuxGiammi picture LuxGiammi  路  3Comments

David-Fu picture David-Fu  路  5Comments

carloabelli picture carloabelli  路  3Comments

vanabel picture vanabel  路  6Comments