Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues with solarized and Terminal.app

Tags:

terminal

vim

I really apologize because I know that this question has been asked multiple times. I have gone through all of the previous questions, but I still have yet to have any luck setting up the Solarized colorscheme in my Terminal.app for OS X Mountain Lion. So far this is what I have: enter image description here

My .vimrc currently is set up like the following:

set number
syntax enable
set background="dark" 
colorscheme solarized

but for my MacVim I get this:

enter image description here

This is what I would like to have my Terminal.app display as well. The only thing that my .vimrc says for MacVim is

colorscheme solarized

Edit

After I had asked this question, I eventually moved to iTerm2, which proved to be much nicer.

I'm not 100% sure, but I think the newer versions of OS X terminal will support 256 colors out of the box.

like image 628
nland Avatar asked Aug 06 '12 03:08

nland


4 Answers

I had the same issue, then I downloaded an alternate implementation of the Solarized theme for the Mountain Lion terminal, and this appears to have solved it.

like image 146
purpletonic Avatar answered Oct 18 '22 14:10

purpletonic


Just add let g:solarized_termcolors=256 to your vimrc

like image 24
Zamith Avatar answered Oct 18 '22 13:10

Zamith


Ensure that TERM is set to xterm-256color to let Vim know that the terminal supports 256 colors. This is the default for Terminal in Lion 10.7 and later†, so your preferences were customized at some point.

To tell Terminal to set TERM to a different value, go to

Terminal > Preferences > Settings > [profile] > Advanced

and change Declare terminal as: to xterm-256color.

[Note that all this preference does is set the value of the TERM environment variable. It does not alter the behavior of Terminal or affect what sort of terminal it emulates.]

† Prior to Lion, the default was xterm-color.

like image 6
Chris Page Avatar answered Oct 18 '22 12:10

Chris Page


Add to your ~/.vimrc

" Solarized Dark
syntax enable
set t_Co=256
let g:solarized_termcolors=256
set background=dark
colorscheme solarized

This works on both ansi and xterm-256color versions of Solarized. Tested on Terminal 2.3 on a new OS X 10.8.5 VM installation.

NB This answer supersedes the previous one that proposed changes to the profile swatches. I recently realised I had these commands in my .vimrc file that actually configured Solarized.

like image 4
1.61803 Avatar answered Oct 18 '22 12:10

1.61803