By default vim highlights tags in comments like TODO, FIXME and XXX, but those three don't usually cover everything, posts like this and this show that there are many other useful tags and also many useful levels of tags so I tried to implement them. After some research I tried to create new syntax group and added the following to .vimrc:
syn keyword myBroken BROKEN ERROR WTF
syn keyword myWarning HACK BUG REVIEW FIXME TODO NOTE
hi def link myBroken Error
hi def link myWarning Todo
However this did not work, so I tried to add these to $HOME/.vim/after/syntax/syntax.vim
, that didn't work either, so I then tried to put it in $HOME/.vim/after/syntax/c.vim
and tried these only in c files, that still didn't work. I checked runtimepath
and it does contain $HOME/.vim/after
, so I was confused.
Then I thought maybe keyword is not matched in comments so I tried to replace syn keyword myBroken BROKEN ERROR WTF
with syn match myBroken /\v<(ERROR|BROKEN|WTF)/ containedin=.*Comment
but that still doesn't work. Any idea on what I did wrong or how to fix this? Thanks in advance.