In my code, something like
#include <whatever>
is highlighted: #include
(which belongs to the group 'cInclude') in pink; and <whatever>
(belonging to the group 'cIncluded') in red.
(Edit: whatever
is any word.)
Also, to highlight the word vector
according to the 'Type' style (in green) I do the following:
:call matchadd('Type','\<vector\>',0)
Here, 0
sets the priority to a low value. With this, my intention is that in
#include <vector>
, <vector>
is highlighted according to the group 'cIncluded', and not according to the group 'Type'.
Unexpectedly, I do not get that result. The highlight for <vector>
in #include <vector>
turns out to be:
<
in red (as in the group 'cIncluded')
vector
in green (as in the group 'Type')
>
in red (as in the group 'cIncluded')
Why?
\<
and\>
actually meanstart-of-word
andend-of-word
in Vims regexp – Christian Brabandt Sep 18 '18 at 8:00<
and>
also included in your match, if I understand the question correctly, right? – Christian Brabandt Sep 18 '18 at 8:27vector
to be highlighted in green everywhere in the code except in the excerpt#include <vector>
, where it should be highlighted in red. And I do not wantvectorize
to be highlighted. – Godoy Sep 18 '18 at 8:34