6

I use syntastic and split windows heavily in my vim workflow. Lately, syntax highlighting will vanish, seemingly at random, in one of my windows, usually after opening a new split. This happens with the highlighting of js files, ruby files, even the highlighting on a vim documentation file opened through a :help command.

Running :syntax enable or :syntax sync from start will, rather than solving the problem, cause it to spread, so that all open windows lose syntax highlighting, rather than just the single window where the problem started.

I understand that this is may not be enough information to help me troubleshoot, but I don't even know where to begin to track down the root problem, since it happens sporadically -- once or twice a day I'd say, without any apparent pattern.

Any clues about what might be the cause, or how I should approach debugging the problem, would be helpful.

Additional Info About Plugins

find ~/.vim -type d -name syntax
/Users/jg/.vim/bundle/neosnippet.vim/syntax
/Users/jg/.vim/bundle/scss-syntax.vim/syntax
/Users/jg/.vim/bundle/tagbar/syntax
/Users/jg/.vim/bundle/unite.vim/syntax
/Users/jg/.vim/bundle/vim-coloresque/after/syntax
/Users/jg/.vim/bundle/vim-css-color/after/syntax
/Users/jg/.vim/bundle/vim-javascript-syntax/syntax
/Users/jg/.vim/bundle/vim-slim/syntax
/Users/jg/.vim/bundle/Vundle.vim/syntax
/Users/jg/.vim/syntax
Jonah
  • 743
  • 6
  • 15
  • Syntastic doesn't add any syntax highlighting, only checking. Maybe one of your other plugins might be involved. – muru Nov 02 '16 at 05:11
  • @muru thanks for your comment. i think it's likely another plugin is involved. the problem is i have about 50, and since the problem appears so sporadically (and can sometimes not appear for days), testing it systematically my turning off plugins and waiting isn't feasible. not to mention the possibility of plugin interaction being the problem. so i'm looking for either 1) a good guess :) or 2) a systematic way to debug it. – Jonah Nov 02 '16 at 06:03
  • We can start by looking only at those that do add syntax highlighting (find ~/.vim -type d -name syntax) – muru Nov 02 '16 at 06:06
  • @muru I updated the OP with that info. Nothing stands out as being an obvious culprit, since I've had all of these installed for months (at least) and this problem has only been going on for 3-4 weeks I'd say. – Jonah Nov 02 '16 at 07:14
  • try disabling vim-coloresque. It is known to be buggy and there exist better alternatives (which you already have installed) – Christian Brabandt Nov 02 '16 at 15:36
  • @ChristianBrabandt, Thanks. I did it and got some new info in the process. Please see my update. – Jonah Nov 02 '16 at 16:46
  • The next time it occurs, try :verbose set filetype? This will a). test whether you are correct that the filetype is being reset. b). tell you what is resetting it. – Rich Nov 03 '16 at 15:20
  • @Rich, it happened again on the vim help file, I tried this and it said: filetype=help Last set from modeline. so my filetype theory seems wrong, or at least incomplete. i then did :syntax enable and the rest of my windows also lost highlighting. – Jonah Nov 05 '16 at 03:52
  • If you're editing multiple files at the same time, try checking your autocommands. Maybe there's set instead of setlocal somewhere. – Thunderbeef Oct 11 '19 at 23:32

0 Answers0