Same behaviour here, char is highlighted, string isn't. I assume this
is desired behaviour since string is strictly speaking not a
"built-in" atomic type that the compiler understands, it is a class
defined in the standard headers that are bundled with the compiler. I
assume the string type uses char internally, which is the actual type
the compiler understands and that vim highlights for this reason.
If vim highlighted every class defined somewhere in the C++ standard
library specification, I guess there'd be a lot of unwanted coloring
going on.
Just my guess.
Mac
>> It's because String isn't a C++ built-in data type, but a custom one
> declared in my header file in a class. Is there a way to highlight specific
> words in a colorscheme? Like in this case 'string' ?
I think you need a customized version the c.vim syntax file so that your
keyword, in the vim sense, is recognized, and then link it to a specific
highlight group.
:h syntax
:h syntax-highlighting
HTH
Gen-Paul.