How can I add new function names for .c and .h files to be highlighted, similar to this
Customizing Syntax Highlighting in Vim but much easier? (as I don’t need to color words in
different colors, only in the default color for keywords as defined by my theme).
I need this to add highlighting for function names in a project written in C which has a clearly defined API.
Thanks
Try putting this in
~/.vim/after/syntax/c.vim:you can see the defined highlight groups with:
if you want to pick your colors:
assuming you use the GUI version and you like red, check
:help highlightfor details.If you want to keep this particular highlight local to a project instead of applying it to every C file, you can add this to your
.vimrcof course the path and the name and location of the syntax file are totally free.