I'm on Ubuntu 18.04, vim-gtk3 8.0.
I'm trying to get gvim to highlight particular words within a comment. For example, take the word 'NOTE'. In a '.c' file: // NOTE(Ryan): ...
and a '.sh' file: # NOTE(Ryan): ...
both instances of 'NOTE' would be highlighted.
Using Highlight whole todo comment line as a guide, my '.gvimrc' is as follows:
augroup CommentMarkers
autocmd!
autocmd Syntax * syntax match NoteMarker /\v\_.<NOTE/hs=s+1 containedin=.*Comment,vimCommentTitle
autocmd Syntax * syntax match TodoMarker /\v\_.<TODO/hs=s+1 containedin=.*Comment,vimCommentTitle
" etc...
augroup END
highlight NoteHighlight guibg=Green
highlight! link NoteMarker NoteHighlight
highlight TodoHighlight guibg=Orange
highlight! link TodoMarker TodoHighlight
" etc...
This works as expected when inside my '.gvimrc' file and a .sh
file. Inside '.c' files however, it does not work. For 'TODO' it gives the default yellow background and 'NOTE' is blank. It seems that '.c' files are ignoring the above commands.
For more info, here is my entire .gvimrc file
Any suggestions would be greatly appreciated.
Thanks!