I want to enable syntax highlighting for custom types in C files. So, in order to highlight a type name
MyCoolType, I add the following line to ~/.vim/after/syntax/c.vim:
syn keyword Type MyCoolType
This works as I expect it. The keyword is highlighted with the color of the Type group.
Now I want to highlight custom types on a per project basis. To do so, I can manually issue
:syn keyword Type MyCoolType, which also highlights the keyword in a currently loaded buffer. This is, however, tedious.
When I add the command to my project-local .vimrc, highlighting does not work. I also tried the following autocommands in my project-local .vimrc, which both did not work.
au BufRead *.c syn keyword Type MyCoolType au FileType c syn keyword Type MyCoolType
Where and how do I define project local keyword highlighting in Vim 8.2?