« Back to Index

[Vim highlighting words]

View original Gist on GitHub

Tags: #vim #highlight #code #comments

Vim highlighting words.md

Vim can highlight certain words inside of code comments, such as…

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