1

I'm using the colorscheme monokai and coc.nvim with pylint to lint Python code in Vim (terminal, not GUI, in terminal.app on macOS which I'm pretty sure has 256 colours). The linting pops up on a black background, so errors (red) are basically readable, but hints (blue) are very difficult to read:

enter image description here

Looking at the colorscheme, I wasn't able to figure out which value to change to get a different coloured background for these messages. For instance I would guess that one of these would be relevant:

hi ErrorMsg ctermfg=231 ctermbg=197 cterm=NONE guifg=#f8f8f0 guibg=#f92672 gui=NONE
hi WarningMsg ctermfg=231 ctermbg=197 cterm=NONE guifg=#f8f8f0 guibg=#f92672 gui=NONE

But 231 per this website is white, so that doesn't seem to be the right line. Are there some defaults it might be inheriting?

Additional info: this really nifty tip shows a way to echo information about the highlight group under the cursor in normal mode, including name and colour. However it doesn't for the pop-up box that coc uses to show lint messages, so I'm still unsure.

0

Answer via this Reddit commenter: these floating boxes are controlled by coc itself.

  • In this case the box is called CocHintFloat and can be seen with :hi CocHintFloat.

  • In general :hi Co<tab> shows you all the possible coc highlight groups.

  • To change it, add eg highlight CocHintFloat ctermfg=Red guifg=#ff0000 to your .vimrc.

  • The background colour is the regular Pmenu specified in most colour schemes.

| improve this answer | |
  • 1
    If CoC is using the new (introduced between 8.1 and 8.2) Vim popups then you should be able to change the background with Popup, too. (Thus not changing PMenu which is used in places other than standard popups.) – B Layer Aug 9 at 20:24
  • Thanks for the tip! As far as I can tell it doesn't, though. – Josh Friedlander Aug 11 at 13:17
  • 1
    Ah, okay. Well it's a tip that will be come more useful with time as Vim's popups get wider adoption. :) Cheers. – B Layer Aug 11 at 17:09

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.