I am having a strange issue with iTerm2, in terminal vim (non-gui) and the solarized color scheme. First, I have set iTerm2 to use the dark solarized colour scheme.
I am also using solarized for vim. I have the following lines in my .vimrc
set background=dark
colorscheme solarized
In the terminal the color scheme looks incorrect:
For reference this is how it looks under MacVim (gui vim)
What do I need to change in iTerm or my .vimrc to get the colors looking correctly in my console vim?
This worked for me in OS X 10.9.1 in iTerm 2 as well as Terminal. One mistake I was making was putting the colorscheme declaration before the termtrans and termcolors settings (and I needed both of these to make it work). As others have said, I set my terminal type to xterm-256color
I struggled with the same problem on OSX 10.11.6, iTerm2 Build 3.0.12.
Here is my fix for it.
.vimrc
syntax enable set background=dark colorscheme solarized
Set Report Terminal Type to
xterm-256color
.From the creator: http://ethanschoonover.com/solarized/vim-colors-solarized
let g:solarized_termcolors=256
A simple way to solve this problem is:
In colors dir on vim-color-solarized exist an arquive named 'solarozed.vim'
Open this file and search:
exe "let s:bg_back = ' ".s:vmode."bg=".s:back ."'"
replace to:
exe "let s:bg_back = ' ".s:vmode."bg=".s:none ."'"
Bill Turner's answer works, but there is a way to get the colors to match MacVim exactly. Solarized has support specifically for iTerm2, among other terminal emulators.
colorscheme solarized
This should set the vim colors in iTerm2 to be exactly as they are in gui editors.
https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized
Download Solarized package (https://github.com/altercation/solarized) and follow instructions:
====================================
Or:
Modify .vimrc
Dark Theme:
Light