I want to highlight a specific word regardless of file type. In my .vimrc, I added:
highlight link notes todo syntax match notes contained "TODO" syntax match notes contained "NOTE" syntax match notes contained "!!!" syntax match notes contained "???"
Note. I also tried syntax match notes "TODO"
(no content).
Unfortunately, I really cannot highlight any of these keywords.
EDIT:
I moved the code to .vim/after/syntax/html.vim
to apply the syntax. Currently, it looks like this:
syntax match todo contained "\<\(TODO\|NOTE\|!!!\|???\)"
Now when I type :syntax
, I get Todo xxx match /\<\(TODO\|NOTE\|!!!\|???\)/ contained
But, when I try to enter an html comment with TODO in it (i.e. <!-- TODO something -->
), highlighting is not applied.
Also, would I need to create .vim/after/syntax/file_type.vim
for each file type, or can I somehow apply this?
source share