Vim stack mess messy syntax

I am using vim for LaTeX and I am using latex-suite. This gives me good syntax highlighting and folding, but in large files, syntax highlighting is getting "messy." If I open all the folds, the syntax highlighting becomes OK. I would like this to β€œjust work” all the time.

I seem to recall an option that would increase the number of lines that are used as the basis for highlighting syntax highlighting, but I cannot find it.

+7
vim syntax-highlighting folding
source share
2 answers

I do not edit LaTeX, but maybe you need " :syn sync fromstart "? Just keep in mind that this can slow down Vim significantly, since it forces Vim to parse the whole file, not the file section. See :help :syn-sync ".

+12
source share
  • Ctrl + L in normal mode forces redrawing and often fixes problems with color syntax.
  • zRzMzx (i.e. expand all folds, arrange all folds, collapse to show the current line) sometimes fixes syntax highlighting problems associated with additions
+9
source share

All Articles