Tags: #vim #highlight #code #comments
Vim can highlight certain words inside of code comments, such as…
BUG
(Golang)FIXME
NOTE
NOTES
(Python)TODO
XXX
The
NOTE
works in both Go and Python files and yet it’s not defined in the Go syntax file, which means it’s likely inherited from a default syntax file.
See the syntax files for…
You can add your own, see this StackOverflow post for the full details, but in summary it looks something like:
augroup myTodo
autocmd!
autocmd Syntax * syntax match myTodo /\v\_.<(TODO|FIXME).*/hs=s+1 containedin=.*Comment
augroup END
highlight link myTodo Todo