I have a strange thing happening on a single file. When I open the file under it's original name, the highlighting is lost (":syntax on" does nothing). But if I cp that file with another name and open it, the syntax highlighting returns. If I mv that copy back to the original file name, the highlighting is gone again.
I can't show you images (as my rep is not high enough), but I assure you if I could, you could clearly see that file a.js has no highlighting while a_copy.js does.
Best Answer
You provide very little information about your environment and configuration, so I can just help you help yourself.
Compare the following options for the two different JavaScript files:
Then check the list of
:autocmd
for any pattern that might target the problematic JavaScript file. Do you use a local vimrc plugin? It might affect this, too.If all that doesn't provide a clue, capture the sequence of commands with
and watch out for commands that affect
'syntax'
.