A few words such as TODO remain highlighted always in VIM.
Can I add some custom words to this list which I want to be highlighted always?
You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.
Todo is a syntax group, :h group-name
to check detail.
If you want to make some words/text highlighted, you can either edit syntax file, or create your own hi-groups (:h highlight-groups
) and add match.
For example:
You can do match todo /!Important!/
to let text !Important!
to be highlighted in same way as TODO
. Or:
hi! Important ctermbg=red guibg=red
this will create a hi-group called Important
.
Then you add match:
:match Important /!Important!/
this will highlight text !Important!
in the way you defined in the group.
You could also add those lines in your vimrc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With