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:
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:
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.
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.
Just add let g:solarized_termcolors=256 to your vimrc
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.
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.
To run vim with 256 colors you must use a 256 color terminal. You can set your terminal to xterm-256color, for example, with export TERM=xterm-256color and then start vim. You can export this $TERM setting in one of your terminal startup scripts (e.g. .bashrc, .zshrc, etc.).
It may seem counterintuitive, but use set g:solarized_termcolors=16. This is confirmed to be the correct setting with :h solarized.
Related
I want to change my colorscheme to this: earthsong on http://daylerees.github.io/
but it changes color something srange. like this (up: molokai, down: earthsong)
I try :colorscheme earthsong in vim, it gives same result.
I using vim on mac (latest version)
I got .vim code from https://github.com/daylerees/colour-schemes/blob/master/vim/colors/earthsong.vim
Can I get some help?
The very first place to look for help with an open source project is its issue tracker if it exists.
That colorscheme only uses your terminal palette. This means that you must adjust it to the colors used in the colorscheme which don't seem to be listed anywhere else than in the colorscheme itself.
If you use Vim 8 and an up-to-date iTerm you could tell Vim to use your GUI colors in the terminal with:
set termguicolors
I'm struggling to make the Solarized colorscheme correctly working on an Ubuntu 13.10 machine inside Vim inside tmux inside the gnome-terminal.
I've started configuring gnome-terminal using the script on this repository and it displays the colors correctly. The same goes if I run Vim (with the official Solarized colorscheme) inside the terminal, without tmux.
Then I tried to configure tmux using this. It happens that when I run Vim the syntax highlight for php or javascript code is wrong or, at least, different from the one I see running Vim without tmux. I've tried also running tmux as tmux -2. The colors are different, but still the syntax highlight is not correct.
I tested it out and got it working in the following way:
Install gnome solarized colorscheme. You can get it from https://github.com/aruhier/gnome-terminal-colors-solarized.
Install solarized colorscheme for vim. You can get it from https://github.com/altercation/vim-colors-solarized. In .vimrc you should add following settings:
set t_Co=256
set background=dark
colorscheme solarized
Set correct TERM variable by adding following line to your .bashrc/.zshrc
export TERM=screen-256color-bce
Run gnome-terminal, tmux, vim and profit.
These days GNOME Terminal comes with Solarized colours built in. To use it, you need to change two settings in the profile that you're using. The obvious one is the text and background colour. You also need to set the palette to Solarized, though. You can find this setting below the one for the text and background colour. At this point, setting t_Co or g:solarized_termcolors in Vim shouldn't be necessary.
The palette is the part that I missed at first, which caused me to puzzle why the text in Vim and other applications was bright blue.
I'm trying to use the light solarized theme with vim and xfce4-terminal.
I installed the theme for xfce4-terminal:
cd
mkdir solarized ; cd solarized
git clone https://github.com/sgerrand/xfce4-terminal-colors-solarized.git
cp xfce4-terminal-colors-solarized/light/terminalrc ~/.config/xfce4/terminal/
Apparently it works fine. However, when I use vim, the colors are different from the expected:
Gvim presents the correct colors. Konsole (with the proper theme, from the same git repository) shows the correct colors too.
The dark theme is presented correctly if change the vim and the xfce4-terminal theme.
I tried to change TERM and t_Co, but it didn't work.
I tried to follow this answer but it remains with the incorrect colors.
The link above says that the xfce4-terminal devs have changed the syntax of terminalrc.
When I compare xfce4-terminal and konsole pallets, I see that the there are some colors different, so I think terminal isn't reading rightly the terminalrc archive. Since the terminalrc archive from git is 2 years old, it makes sense. However, I don't know how to modify to the correct colors since I don't know the correspondence between the pallets of Konsoleand Xfce.
Does anyone have a suitable archive? Does anyone want to create one and make it available via git, updating the config for other people? (presuming that it's in fact a problem with the recent syntax.)
oK got it work!
You cannot use the colors which are on git hub xfce4-terminal
For the dark you can use the one which comes with xfce-terminal (Edit->Properties->Color->Presets * Solarized (dark/light)
Important is that you go afterwards to ~/.config/xfce4/terminal/terminalrc and remove
ColorCursor=
Than edit the .vimrc with
syntax enable
set background=dark
colorscheme solarized
set t_Co=16
set background=dark works for me with light and dark terminal setting.
I have exactly the same problem.
I get the best results with this.
It is not 100% the same but looks best to me
let g:solarized_termcolors=256
syntax enable
set background=light
colorscheme solarized
set t_Co=256
Hope that helps
I downloaded the Dark.vim color scheme from here:
http://vimcolorschemetest.googlecode.com/svn/html/index-c.html (Click on Dark.vim to see the code)
Then put it in ~/.vim/colors.
I also did the same for 256-jungle.vim and af.vim.
:colorscheme Dark, :colorscheme af, etc. all work (i.e. they change vim's syntax highlighting) but none of them look like the screenshots in the link above.
Instead, they look like this (ordered af.vim, 256-jungle.vim, Dark.vim): http://imgur.com/a/NsmHy
At first I thought this might be a problem with the color-settings in my terminal, so I followed tips from a "256 colors in vim" Vim wiki-doc page, which told me to add the following to my ~/.bash_profile :
TERM=xterm-256color
# for enabling 256 color, as per http://vim.wikia.com/wiki/256_colors_in_vim
if [ -e /usr/share/terminfo/x/xterm-256color ]; then
export TERM='xterm-256color'
else
export TERM='xterm-color'
fi
This didn't work.
Also, here's what's in my ~/.vimrc file:
set tabstop=2
set t_Co=256
colorscheme 256-jungle
colorscheme Dark
syntax on
let $VIM='~/.vim/'
Any thoughts on what's causing this disparity between what the colorschemes "should" look like and what's actually being displayed in my terminal? I'm running Mac OS X 10.8.2.
Thanks in advance for any help.
The Dark colorscheme you tried to use in terminal is actually a scheme for GUI (if you take a look at it's code, you'll see only 'guifg, guibg' etc. definitions). To run gui colorschemes in a terminal you can try CSApprox plugin.
I want to use solarized, which gives a decent color scheme in Vim. It works by setting the 16 colors ansi colors in the gnome-terminal. It works fine if I use Vim from bash, but in zsh the colors are off. Some letters have the right background, but most have too light background. What is it about zsh that interferes with the ansi colors as displayed by Vim?
I can't reproduce this - if this is still an issue, perhaps giving relevant sections of ~/.bashrc, ~/.zshrc, ~/.vimrc etc might help.
I'm using the Solarized vim colorscheme, and the linked Gnome-Terminal settings in the following screenshots. As you can see, they appear to be identical - there's certainly no color issues in either zsh or vim that I've noticed (I don't use bash much).
My zsh settings are taken from oh-my-zsh, and my prompt is a hacked-up version of Phil!'s ZSH prompt (I have messed with the coloring of Phil!'s ZSH prompt, because it didn't play well with the Solarized iTerm2 colors). However, I do not think I've messed with anything that would affect the Solarized colorings between bash and zsh in vim. Certainly the vim settings are identical between the two screenshots below.
I had the same problem on Ubuntu 14 with zsh.
This fixed it (in the .vimrc)
let g:solarized_termcolors=256
set background=light
colorscheme solarized
I know this is a veeery old question but I had the same problem and came across this so I thought it could still be useful to someone if I answered it.
For me TERM was not set to xterm-256color in zsh like it was in bash so the colours were messed up in vim.
Simply adding export TERM=xterm-256color to the .zshrc file fixed the problem.