scss-syntax.vim
scss-syntax.vim copied to clipboard
Very slow for files over 1000 lines
Hey!
Thanks for taking the time to write VimL!
However, is it me or is the SCSS syntax highlighting particularly slow for long files? Or in that sense, slow for any file, but particularly noticeable for larger files. Switching back and from the highlighted buffer ends up taking half a second...
Oh, I didn't remember I reported this 5 years ago. Anyways, I've tracked this down to the https://github.com/cakebaker/scss-syntax.vim/blob/master/ftdetect/scss.vim#L2 line:
au BufEnter *.scss :syntax sync fromstart
Given a long file, this causes quite the delay when entering the buffer, and seems unnecessary as well.
Thanks for your comment.
I don't think the command is unnecessary. Without it, I get highlighting errors from time to time. What you could try in your .vimrc
is to either clear the sync settings with:
au BufEnter *.scss :syntax sync clear
or to use minlines
instead of fromstart
:
au BufEnter *.scss :syntax sync minlines=100
Hope that helps.