'Properly highlighting macros for C in Vim
I would like to highlight certain function-like macros for C in Vim, and I'm having trouble with what type of highlighting category I should give it. The goal of this is to add highlighting support for some C libraries.
At a first glance, looking at c.vim the most suitable keyword groups seems to be cConstant, cPreProc, cDefine and cOperator. Here cPreProc and cDefine are made to go along with #, which leaves me to cOperator and cConstant. I'm not very proficient in computer science, but macros does not seem to (in general) fit very well into operators, and so this leaves me to cConstant. I could interpret this as a constant expression modulo inputs, which then makes sense.
Is cConstant the best fit for this, should I define a new highlighting group, or should I not highlight them at all?
Solution 1:[1]
Typing :help group says that the group Macro is the same as Define, which is what cDefine is linked as. Thus, one should use cDefine or perhaps define a new group called cMacro which is linked to Macro. Don't really know why Bram made it like this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | aahlback |
