Make Vim ignore syntax highlight only for long lines

Viewed 933

Recently I found out that long lines in Vim take forever to redraw, and even can give you error:

E363: pattern uses more memory than 'maxmempattern'

or

'redrawtime' exceeded syntax highlighting disabled

Increasing those values make things even worse… So I though of more efficient way to solve this problem, ignoring syntax highlight for only those long lines will be enough.

So can this be done in Vim: Ignore highlight only for long lines, e.g. skip highlighting for those lines?

2 Answers

add the following line to your .vimrc file:

set re=0

I found out what was causing such slowdown - it was caused by php syntax from vim-polyglot plug-in, fixed it by disabling php through let g:polyglot_disabled = ['php'].

Related