Search code examples
terminalcolor-schemeiterm2

How do you get color to show in iTerm2?


How do you get color to show in iTerm2 or in the terminal?

I managed to get my Vim editor to show color. Here's what I have in my .vimrc file.

set term=xterm-256color

color scheme evening

syntax enable

From my research, I think there might be something missing from the terminfo file but I have no idea what to do with that. I am using Mac OS X 10.9.1


Solution

  • I use VIM and iTerm 2 on OS X 10.9.1. In my .vimrc, I have the following (note that I'm using the molokai colorscheme, you would switch that with 'evening'):

    let &t_Co=256
    colorscheme molokai
    syntax on
    

    Those settings worked best for me. Those settings also resolved some issues I was having with colors while using VIM in a tmux session.

    Also, in iTerm's preferences, under Profile > Whatever Profile You're Using > Terminal, make sure "Report Terminal Type" is set to:

    screen-256color
    

    Hope that helps.