Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom colorscheme not working on VIM

Here's what I did:

cp ~/.vim/colors/ir_black.vim /usr/share/vim/vim72/colors/

Then tried to open some code and :colorscheme ir_black

It changes a few colors but makes most of the text start to blink with the cursor. It happens with almost all the other custom colorschemes as well. Does anyone have any ideas of what might be wrong?

I added t_Co=256 to my .vimrc file and it didn't seem to help.

PS: I'm on a Mac OS X.

like image 365
Bernardo Oliveira Avatar asked Jan 13 '11 23:01

Bernardo Oliveira


People also ask

How do I add Colorscheme to vim?

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.

What is vim default Colorscheme?

The default Vim color scheme in a light terminal is peachpuff . If you use a dark terminal, the initial color scheme is ron .


2 Answers

Set your TERM to xterm-256color. Follow up on the iterm2 mailing list if that still doesn't work.

like image 176
George Avatar answered Oct 27 '22 13:10

George


Edit : I found an exact duplicate of your question :here. It seems to be an issue with iTerm not supporting 256 colors by default.

The usual problem with color scheme and terminal is that terminal are often limited to 256 colors, and GUI color scheme are using 2^32 colors. So some of them are not correctly rendered in terminal.

There is a simple test to check: if you are lauching the GUI version is the color scheme rendered correctly ?

The possible solution are :
1. Convert your color scheme to 256 colors using the following plugin : CSApprox.vim
2. Choose a different color scheme. (Often on Vim.org color schemes compatible with Terminal have "256" in their name, like "wombat256" for example)
3. Use a GUI version like MacVim or GVim

If I remember correctly, the color sheme Zenburn is working nicely with both GUI and terminal version. It is rather dark with pastel colors.

Personal story : after spending ages to fiddle with color scheme to get something right for terminal, I switched to the GUI version. The GUI version with the icon bar hidden is not really different to terminal version anyway, as long as you are working locally

like image 29
Xavier T. Avatar answered Oct 27 '22 11:10

Xavier T.