Vim spellcheck not always working in .tex file. Check region in Vim

帅比萌擦擦* 提交于 2019-11-28 17:51:53

syntax/tex.vim already uses quite elaborate sync patterns to ensure that the syntax highlighting is accurate, but for long and complex documents, this may still fail.

Best you can do is trying to increase both values of

syn sync maxlines=200
syn sync minlines=50

(e.g. to 2000 and 500). Put this in ~/.vim/after/syntax/tex.vim to override the defaults.

syntax sync fromstart

might give the best results, but may be too slow. You'll find a description of syntax syncing at :help :syn-sync.

Dominik

Spell checking is not done where no syntax group are defined (or found by vim). I find it useful to enable spell checking even for the undefined group (see toplevel in vim's syntax documentation).

To do so, write the command:

syntax spell toplevel

in the file ~/.vim/after/syntax/tex.vim. Make the file if it does not exist.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!