문제

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

도움이 되었습니까?

해결책

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.

다른 팁

colorscheme is supposed to be written as a single word. I don't think setting term is necessary from within .vimrc.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top