Eddie Parker
Eddie Parker

Reputation: 4888

gvim: Colour lines differently containing TODO/HACK/etc?

Often I'll put comments in code like TODO/HACK/BUG: I'd love if these showed up glaringly when I did a diff of the code in vim.

Is there an easy way to set this up?

Upvotes: 0

Views: 355

Answers (1)

ronakg
ronakg

Reputation: 4212

You can define a syntax group like this:

:syntax match TODOs ".*TODO.*\|.*BUG.*\|.*HACK.*"

This will match entire lines which contain either TODO, BUG or HACK in them.

Then you can use the highlight command to highlight it.

:highlight TODOs ctermbg=red ctermfg=yellow term=bold,italic

You can add both the lines to your vimrc or the syntax file for appropriate file types.

Upvotes: 2

Related Questions