Skip to content

Highlight illegal characters #2960

@Unturned3

Description

@Unturned3

Description

The syntax highlighting that vimtex provides doesn't seem to highlight illegal characters, e.g. an underscore in the document body.

Steps to reproduce

minimal.vim

set runtimepath^=~/.vim
let &packpath = &runtimepath
call plug#begin()
	Plug 'lervag/vimtex'
call plug#end()

minimal.tex

\documentclass{article}
\begin{document}
Illegal characters should be highlighted: _
\end{document}

Expected behavior

If I run nvim -u none minimal.tex (i.e. default colorscheme, not loading vimtex), then the illegal underscore is highlighted red.

Screenshot 2024-05-28 at 22 05 15

Actual behavior

If I run nvim -u minimal.vim minimal.tex, the illegal underscore appears normal.

Screenshot 2024-05-28 at 22 05 03

Do you use a latexmkrc file?

No

VimtexInfo

System info:           
  OS: macOS 12.7.1 (21G920)
  Vim version: NVIM v0.9.5                 
  Has clientserver: true
  Servername: /var/folders/3d/_tm29bhn48l851qxdsg5w39m0000gn/T/nvim.richard/YOxDmr/nvim.72266.0
 
VimTeX project: test
  base: test.tex
  root: /Users/richard/Desktop/vimtex
  tex: /Users/richard/Desktop/vimtex/test.tex
  main parser: current file verified
  document class: article
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions