octol / vim-cpp-enhanced-highlight

Additional Vim syntax highlighting for C++ (including C++11/14/17)
MIT License
1.06k stars 150 forks source link

Syntax highlighting not working #39

Closed marmot21 closed 7 years ago

marmot21 commented 7 years ago

I have installed the plugin using Vundle, however I am not seeing the correct syntax highlighting.

image

I have tried disabling all other plugs, no change.

dawikur commented 7 years ago

You need to set g:cpp_experimental_simple_template_highlight or g:cpp_experimental_template_highlight before loading after/syntax/cpp.vim file. That's Because bit is checking those variables on creating syntax (when syntax file is parsed), not when source code is highlighted.

Simply add

let g:cpp_experimental_template_highligh =1

to your vimrc.

marmot21 commented 7 years ago

I added that line to my vimrc file, no effect, but I see you're right - if I do let g:cpp_experimental_template_highligh =1 then set syntax=cpp it works.

Why would it not be working when it's in the vimrc file?

dawikur commented 7 years ago

I would say wrong order of assigning variable and loading plugin, but I am not sure. I don't know your vimrc so this is just a guess.

octol commented 7 years ago

Glad the issue has been resolved. Closing.