I am trying the jellybeans theme.

colorscheme jellybeans

The issue is that the jedi vim auto completion tips for functions appear with white text on white background:

enter image description here

Here is how they appear when the theme is de activated:

enter image description here

I'm not sure if this is due to my terminal or to a setting to be changed in jellybeans or in vim.

Here are the results of Pmenu and PmenuSel

:verbose hi Pmenu
Pmenu          xxx ctermfg=7 ctermbg=7 guibg=Magenta
        Last set from ~/.vim/bundle/jellybeans.vim/colors/jellybeans.vim line 415

:verbose hi PmenuSel
PmenuSel       xxx ctermfg=7 ctermbg=7 guibg=DarkGrey
        Last set from ~/.vim/bundle/jellybeans.vim/colors/jellybeans.vim line 415
  • What do you get for :hi Pmenu and :hi PmenuSel with this theme? Please edit the question to include those results.
    – filbranden
    May 13 '20 at 17:22
  • It's odd, it seems this should be Pmenu ctermfg=White ctermbg=Grey and no idea where this "Magenta" is coming from... (github.com/nanotech/jellybeans.vim/blob/master/colors/…) Do you have any overrides in your vimrc? In any case, it looks like you're not using a 256 color setup. Maybe try to add set t_Co=256 to your vimrc to see if you get better colors by having more of them available?
    – filbranden
    May 13 '20 at 17:38
  • Oh! This one is also very useful: :verbose hi Pmenu and :verbose hi PmenuSel, they will show where this is being set from.
    – filbranden
    May 13 '20 at 17:42
  • 1
    set t_Co=256 is the solution thanks a lot! May 13 '20 at 18:25
  • 1
    Glad this fixed it! I just posted an answer with the solution that worked for you and some more rationale of what likely caused the issue and a further solution you might want to look into for other programs that you run on your terminal and might want to use more colors. Cheers!
    – filbranden
    May 13 '20 at 18:41

The jellybean color scheme tries to provide fallbacks for when fewer colors are available from the terminal. When less than 256 colors are available (to be more exact, less than 88), it will try to use "White over Grey" for the Pmenu highlight group. And when there are only 8 colors available (NR-8), then both "White" and "Grey" map to the same color 7. So that's probably what was happening.

I believe the best solution is to set up your terminal to use 256 colors. Most modern terminals support 256 colors these days (and some even more), so there's little reason not to use that.

In Vim itself, you can set that up using this command in your vimrc:

set t_Co=256

Or you can fix that in your terminal itself or the shell, by having it set a $TERM variable to a terminfo/termcap entry that has 256 color support. For instance, if you currently have TERM=xterm, then switching to TERM=xterm-256color would fix that in Vim and in other applications that want to use terminal colors and want to query how many colors the terminal supports.

(You can always use :set t_Co? to check how many colors Vim thinks the terminal supports.)

(If you decide to fix that in your terminal so other programs you run will also get fixed, I suggest you post a question in a more appropriate forum, depending on which OS you're on. Make sure you mention which terminal program you're using, whether you're using tmux or screen, and what the value of the $TERM variable currently is.)

  • 1
    yeah, setting t_Co seems to be problematic IMO, unless you're in complete control of all the systems you use vim on. (I have my config on some other remote machines, and this bit me once.) Better to rely on TERM and inference from terminfo databases etc., and then to make sure TERM is properly set
    – D. Ben Knoble
    May 13 '20 at 22:24

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.