Solarized theme on Vim + Terminator + Ubuntu 11.10
Asked Answered
H

3

5

I am trying to setup solarized theme for vim on Terminator but it is not working. :-( I was successfully able to setup solarized for terminator but it just doesn't seem to work for vim. Here is what my .vimrc looks like

call pathogen#infect()
filetype plugin indent on
syntax enable
set background=dark
"set t_Co=16
"let g:solarized_termcolors=16
let g:solarized_visibility = "high"
let g:solarized_contrast = "high"
colorscheme solarized

$TERM is set to xterm

I have also tried it with the two lines above uncommented but still not working.

Could someone please tell me what I am doing wrong?

Thanks!

Edit: solarized vim

Hinge answered 2/2, 2012 at 7:42 Comment(7)
What do you mean by "it is not working"? Do you have error messages, or glitches or wrong colors?Integration
How wrong? You are talking about a colorscheme: a screenshot or two may help.Integration
didn't know there is an option to upload screenshots on stackoverflow. Updated the post.Hinge
Do you have a screenshot of what it is supposed to look like?Integration
This should be asked on superuser.comEakins
Try github.com/sigurdga/gnome-terminal-colors-solarizedNumbat
For my own reference; do you mind posting a screenshot of terminator where you've done a 'ls -las' at the bash prompt?Audit
A
8

Pretty sure you don't need the vim color theme import, since you already set up the color scheme for terminator. At least, that was the only way I could get it to play nice after lots of trial and error.

Here's a screenshot of my vimrc, from vim, within terminator:

enter image description here

As you can see, I haven't got the line

colorscheme solarized

So you could try taking that out - it finally seems to be working for me!

ps your screenshot doesn't look like it was taken from within terminator - unless we are talking about different terminators, of course.

Aeneid answered 14/3, 2012 at 7:55 Comment(6)
Sorry for late reply eggonlegs. You are THE MAN! It worked beautifully. Thanks much! :-)Hinge
woohoo! glad it worked :D Also note the line 'call togglebg#map("<F5>"), lets you flip the colorscheme to inverted solarizedAeneid
This does work. I was working on multiple machines and syncing the vimrc among them. If I remove the colorscheme line, on the other machine, it doesn't work. Is there any common way which can fix this problem on terminator?Gerdi
Han He: need more information tbh, but sounds like you need to set up the terminator colorscheme on the other machine.Aeneid
I wrote a kind of long answer (see below), but it should cover every 'use case':). And afaik in imho it should be the correct way to go, because if you you don't choose the colorscheme you are not going to get the benefits of having one. The problem and color issue is because terminal palette is different from the one that comes with the vim plugin.Crispin
This works for me as well. Another thing to point out - my CSApprox plugin was masking what was going on, and is unnecessary for Solarized.Batory
C
13

As Ethan Schoonover pointed out in his vim colorscheme readme, to make the colorscheme work first you have to configure your terminal colour palette.

In terminator there is a github repo that holds the colour configuration for the dark and light scheme.

The problem is that that palette isn't right either :P, the correct one is the one a guy posted in an issue on that same repo.

The correct configuration is the following (at least for the dark scheme):

[[solarized-dark]]
  palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
  cursor_color = "#eee8d5"
  foreground_color = "#eee8d5"
  background_color = "#002b36"

After that, you have to configure the solarized colorscheme:

syntax on
set t_Co=16
set background=dark
colorscheme solarized

A couple of things to have in mind:

  1. Normally, the set t_Co=16 line is not necessary because most terminal emulators only support 16 colours (terminator for example). But I rather be explicit than implicit (specially if you are going to sync your files between multiple computers).

  2. The line set g:solarized_termcolors=16 is the default, so you can put it or not: it won't make any difference.

  3. In my experience the 256 colour version is better (I like more grey background over a blue one; but that's personal taste :P). Contrary to what everyone could think, the 256 colour scheme is actually the 'fallback' being the 16 one the default. Yeah, weird, most people would think that 256 > 16. Anyway, to use the 'fallback' you have to change the lines to the following:

    set t_Co=256
    set g:solarized_termcolors=256
    
  4. There are actually some issues with colour output in other CLI applications, I suggest you to go and read Seebi article about dircolors and an ongoing(?) discussion on the solarized github issue tracker.

Crispin answered 1/8, 2012 at 14:40 Comment(1)
Any graphic Vim (MacVim, gVim) uses 16 million colors, so the colorscheme can just pick the precise 16 colors it needs. Terminal Vim needs to either use previously selected 16 colors (from your terminal emulator colorscheme) or approximate the colors from the 256 colors colorspace. That's why Ethan calls it the degraded colorscheme.Paunchy
A
8

Pretty sure you don't need the vim color theme import, since you already set up the color scheme for terminator. At least, that was the only way I could get it to play nice after lots of trial and error.

Here's a screenshot of my vimrc, from vim, within terminator:

enter image description here

As you can see, I haven't got the line

colorscheme solarized

So you could try taking that out - it finally seems to be working for me!

ps your screenshot doesn't look like it was taken from within terminator - unless we are talking about different terminators, of course.

Aeneid answered 14/3, 2012 at 7:55 Comment(6)
Sorry for late reply eggonlegs. You are THE MAN! It worked beautifully. Thanks much! :-)Hinge
woohoo! glad it worked :D Also note the line 'call togglebg#map("<F5>"), lets you flip the colorscheme to inverted solarizedAeneid
This does work. I was working on multiple machines and syncing the vimrc among them. If I remove the colorscheme line, on the other machine, it doesn't work. Is there any common way which can fix this problem on terminator?Gerdi
Han He: need more information tbh, but sounds like you need to set up the terminator colorscheme on the other machine.Aeneid
I wrote a kind of long answer (see below), but it should cover every 'use case':). And afaik in imho it should be the correct way to go, because if you you don't choose the colorscheme you are not going to get the benefits of having one. The problem and color issue is because terminal palette is different from the one that comes with the vim plugin.Crispin
This works for me as well. Another thing to point out - my CSApprox plugin was masking what was going on, and is unnecessary for Solarized.Batory
E
1

Try adding this to your .vimrc file

let g:solarized_termcolors=16

The rest of the settings in the screenshot are fine.

Efficiency answered 2/2, 2012 at 15:48 Comment(1)
Thanks for the reply Bosvark, I tried it with that and everything looks gray with that setting.Hinge

© 2022 - 2024 — McMap. All rights reserved.