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

前端 未结 2 1331
执念已碎
执念已碎 2020-12-13 06:41

I use Vim to write my .tex files, but I am having trouble with the spell checker in Vim. Sometimes it does not check the words, and I think that it might be fo

相关标签:
2条回答
  • 2020-12-13 07:20

    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.

    0 讨论(0)
  • 2020-12-13 07:25

    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.

    0 讨论(0)
提交回复
热议问题