syntax highlighting breaks off on vim as you page up/down (on OSX terminal and iterm2)

1

This is a weird bug

the problem is the syntax highlighting (say zenburn) on vim randomly appears and disappears as I page up and down (using ctrlu and ctrld).. for example compare these two renders of the same file:

enter image description here and this one

enter image description here

so to switch between those two screens, i simply have to page up and down.. and it just appears and disappears (note: i confirmed the same behavior on both iTerm2 and terminal).

Also notice that for files that are small (ie doesn't have enough room to page up and down) the syntax highlighting doesn't appear at all.

How do I fix this?

abbood

Posted 2017-10-04T06:07:59.503

Reputation: 702

2I'm not sure why this happens. Sometimes vim just fails highlighting. You can use :syntax sync fromstart to have it "redraw" your code. I have it set up like this <leader>sy :syntax sync fromstart<cr> – Michael – 2017-10-14T13:23:21.227

http://vim.wikia.com/wiki/Fix_syntax_highlighting – oalders – 2018-07-12T15:07:24.700

No answers