1

I am new to vim and am trying to set a colorscheme. However, for both pre-installed and new colorschemes, the only thing that happens when I change the colorscheme is the background color changes. For example, :colo evening shows up with just a lighter gray background; :colo pablo changes nothing at all. Regardless of if I change it in the vimrc file or manually in a file, the result is the same. I am using iTerm2.

What am I missing here?

Update: changing colorscheme now changes the background color as well as other messages such as "a .swp file exists"... However, the text color of the actual program does not change.

1

The most likely scenario is that the the colour scheme is changing correctly, but that Vim isn't actually displaying the colours anywhere because you don't have syntax highlighting enabled.

Try running the command:

:syntax on

If that fixes it, you can add it to your vimrc file.

As @13312 hints, it's also possible (but unlikely) that Vim believes itself to be running in a black and white terminal. If this is the case, then set t_Co? will output 0: this is the number of colours that Vim believes the terminal supports.

This indicates there is a problem with your terminal configuration. If that is the case, then adding set t_Co=256 as they suggest will force Vim to act as though the terminal supports 256 colours (regardless of whether this is actually the case).

However, much better fix would be to fix your terminal configuration so that Vim uses the correct value automatically, as it should. The first thing to check is the output of the command tput colors when run in your shell.

0

try adding

set t_Co=256 

to your .(g)vimrc

try opening vim from terminal as well and see if the colors are correct (if so you'll have to toggle the color settings in iTerm's profile settings)

also download MacVim if you haven't already

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.