lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.29k stars 386 forks source link

Syntax error using neovim #2781

Closed stefankiebacher closed 10 months ago

stefankiebacher commented 10 months ago

Description

I get the following error when opening a *.tex file

Error detected while processing function vimtex#syntax#core#init_post[12]..vimtex#syntax#packages#init[14]..vimtex#
syntax#p#amsmath#load:
line   10:
E121: Undefined variable: #
E116: Invalid arguments for function vimtex#syntax#core#new_env

Steps to reproduce

with test.vim:

" Specify a directory for plugins
call plug#begin('~/.config/nvim/plugged')
Plug 'lervag/vimtex'
call plug#end()

let g:python3_host_prog = "/usr/bin/python3"
let g:python_host_prog = "/usr/bin/python2.7"

filetype plugin indent on
syntax enable

let g:vimtex_quickfix_enabled = 1

let g:vimtex_view_general_viewer = 'okular'
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'

let g:vimtex_compiler_method = 'latexmk'
let g:vimtex_compiler_latexmk = {
      \ 'build_dir' : '',
      \ 'callback' : 1,
      \ 'continuous' : 0,
      \ 'executable' : 'latexmk',
      \ 'hooks' : [],
      \ 'options' : [
      \   '-verbose',
      \ '-pdf',
      \   '-file-line-error',
      \   '-synctex=1',
      \   '-interaction=nonstopmode',
      \ ],
      \}
let g:vimtex_parser_bib_backend = 'bibtex'
let g:vimtex_fold_bib_enable = 1
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_MultipleCompileFormats='pdf,bibtex,pdf'
let g:vimtex_compiler_latexmk_engines = {
      \ '_'                : '-pdf',
      \ 'pdfdvi'           : '-pdfdvi',
      \ 'pdfps'            : '-pdfps',
      \ 'pdflatex'         : '-pdf',
      \ 'luatex'           : '-lualatex',
      \ 'lualatex'         : '-lualatex',
      \ 'xelatex'          : '-xelatex',
      \ 'context (pdftex)' : '-pdf -pdflatex=texexec',
      \ 'context (luatex)' : '-pdf -pdflatex=context',
      \ 'context (xetex)'  : '-pdf -pdflatex=''texexec --xtx''',
      \}
let maplocalleader = ","
map <f5> :w<cr>,ll

Expected behavior

No error message

Actual behavior

above error message

Do you use a latexmkrc file?

No

VimtexInfo

For using nvim -u test.vim main.tex running :VimtexInfo I get the following:

System info:
  OS: openSUSE Leap 15.4
  Vim version: NVIM v0.4.4
  Has clientserver: true
  Servername: /tmp/nvimQrFWWC/0

VimTeX project: fission
  base: fission.tex
  root: /users/tp/kiebacher/Documents/physik/phd/Projects/BetterClusters/paper
  tex: /users/tp/kiebacher/Documents/physik/phd/Projects/BetterClusters/paper/fission.tex
  main parser: current file verified
  document class: svjour
  packages: algorithm algorithmic amsbsy amsfonts amsgen amsmath amsopn amssymb amstext atbegshi atbegshi-ltx atveryend atveryend-ltx auxhook bigintcalc bitset caption caption3 cite color epstopdf-base etexcmds float gettitlestring graphics graphicx hycolor hyperref iftex ifthen infwarerr inputenc intcalc keyval kvdefinekeys kvoptions kvsetkeys letltxmacro ltxcmds multirow nameref pdfescape pdftexcmds refcount rerunfilecheck snapshot subcaption trig uniquecounter url
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -pdf
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 0
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile
lervag commented 10 months ago

Please update your neovim, it is ancient! I know I claim that VimTeX supports neovim 0.4.3, but it is not really correct any longer and in the relatively close future I will bump the requirements all the way to neovim 0.9.

stefankiebacher commented 10 months ago

Ok Thanks for having a look! Works with the new stable neovim

lervag commented 10 months ago

Good, glad to hear it :)