Vim - 256 colors enabled, only 16 work

1.1k Views Asked by At

I can't modify my Vim colors using the 256 colors grid (http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html). Unfortunately, only the 16 basic colors work. Colors from the 256 colors grid are replaced by an equivalent in the 16 colors grid: color 88 will become color 1, 214 will become 11, 224 will become 15, etc.

Here is what I use in my ~/.vimrc concerning colors:

set t_Co=256
highlight comment ctermfg=grey
highlight constant ctermfg=224
syntax enable

With this code, comments are grey and constants are white (whereas they should be beige).

I thought it would be of use to let you know that when I typed tput colors in my shell, the result was "256", which means (if I am not mistaken) that 256 colors are enabled. When I typed echo $TERM, the result was "xterm-256color", and if I am not mistaken (again), this means that I have correctly installed a 256-colors plugin.

It may be useful for you to know that I use zsh.

I ran some scripts to show the supported colors of my terminal, here is the result: enter image description here

I don't understand why I can't use the 256 colors package. Where am I wrong?

0

There are 0 best solutions below