I have put this in my .vimrc

highlight IgnoreGroup ctermbg=Black ctermfg=White
let m = matchadd("IgnoreGroup", '\\todo{.\{-}}')

This gives me the following result:

enter image description here

Note that the \todo{stuff} stands out compared to the background.

How can I make it blend with the dark background?


The backgroud color is set by the normal group.

You could check your colorscheme and use the same colour, which is probably not plain "black".

The highlight command can help you observe each highlight. This will show you the settings for the normal group only:

:hi normal

You could even link your group to the normal group:

:hi link IgnoreGroup normal
  • Using hi link IgnoreGroup normal makes it look like normal text and spell check remains activated inside \todo which is something I want to avoid. I tried to use the colorscheme idea. I am using gruvbox and I looked at gruvbox.vim and searched for background But I could not see any color assigned to it. – caffeinemachine Jun 3 '20 at 3:38
  • 1
    Finding the background color using :hi normal worked. Thanks. – caffeinemachine Jun 3 '20 at 4:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.