I try to apply various color schemes in vim that I have seen on the net. Whatever scheme I choose, the background remains white, even though screenshots of the applied scheme shows that the background should be colored.
In some schemes, some of the background change color, but space right of lines containing text still remains white.
I'm using Vim 7.2 on a mac. I have just started messing with non-gui applications, so everything should be pretty much as it was out of the box..
Does the overall settings for the terminal window have something to do with it?
When running macvim, everything looks ok. Its only when starting vim from the terminal things looks strange..
The ctermfg=white is used to set the foreground color to white in a terminal text editor. Finally, the ctermbg=black is used to set the background color to black in a terminal text editor.
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.
In Vim, if your color scheme supports both a light and dark mode, you switch between by using the command: set background=dark or set background=light . In Alacritty, you can define multiple color schemes and switch between them easily in the config file alacritty.
I have this in my .vimrc and it solved this problem for me using while using PuTTY.
set t_Co=256 set background=dark colorscheme mustang highlight Normal ctermbg=NONE highlight nonText ctermbg=NONE
It's important to load the colorscheme before the ctermbg settings in .vimrc because they need to override the same ones set by the colorscheme. This also means you can't switch colorscheme while Vim is running and expect it to work.
I'm adding a second answer from me because it's very different from my first answer and may point to actual problem.
If you look at the actual website for the colorscheme here: Molokai website
you will see a question very similar to yours. Here's answer given, which suggests trying command :set t_Co=256
in your vimrc to see if it fixes things:
"- Make sure you’re using a console terminal capable of 256 colors; not all of them do (particularly on mac). You might need to explicitly force Vim to use that by doing “set t_Co=256″ on your .vimrc file. - The windows console is well… totally unsupported, that only does 16 colors so it’s a mess"
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