I would recommend using syn keyword for this. There are other options, such as :match , as suggested by michael.kebe and syn match , etc., but they are all based on regular expressions. The disadvantage of this is that as the number of words you want to combine increases, the Vim speed decreases. Keyword macros are much faster. You can also easily identify multiple keywords per line (although there is a limit of approximately 512 characters in the line if memory is correct for me).
syn keyword Todo word1 word2 word3 syn keyword Todo word4 syn keyword Todo word5
Place these lines in any file and :source or upload it to your ~/.vim/after/syntax/c.vim so that it is source d automatically for all C files (select the syntax file for the file type you are interested in).
As with michael.kebe's answer, the first parameter ( Todo in this case) is the highlight group. You can create your own group if you want and define a selection:
syn keyword MyHighlightGroup word6 word7 " Then EITHER (define your own colour scheme): hi MyGroupName guifg=Blue ctermfg=Blue term=bold " OR (make the colour scheme match an existing one): hi link MyGroupName Todo
DrAl Nov 12 '10 at 9:17 a.m. 2010-11-12 09:17
source share