You are not logged in.

#26 2014-10-26 13:26:04

svxiii
Member
Registered: 2014-09-17
Posts: 21

Re: Getting solarized colors right with urxvt, st, tmux and vim

Using urxvt already. Sorry I forgot to mention that.

Also, this is my vimrc, in case it helps:

set nocompatible
set t_Co=16
call pathogen#infect()
syntax on
set background=dark
colorscheme solarized
filetype plugin on
set cursorline
call togglebg#map("<F5>")
set mouse=a
set ttimeoutlen=100
set number
set ruler
set autoread
set tabstop=4
set shiftwidth=4
set expandtab
set smarttab
set autoindent
set list listchars=tab:•\ ,trail:·
set hlsearch
filetype indent on
set laststatus=2


function! CurDir()
	let curdir = substitute(getcwd(), '/home/svxiii/', "~/", "g")
	return curdir
endfunction

function! HasPaste()
	if &paste
		return 'PASTE MODE	'
	else
		return ''
	endif
endfunction

set statusline=%{&ff}\ \%{&fenc}\ \b%1.3n\ \%#StatusFTP#\%Y\ \%#StatusRO#\%R\ \%#StatusHLP#\%H\ \%#StatusPRV#\%W\ \%#StatusModFlag#\%M\ \%#StatusLine#\%f\%=\%1.7c\ \%1.7l/%L\ \%p%%

Last edited by svxiii (2014-10-26 13:33:40)

Offline

#27 2014-10-26 22:13:24

svxiii
Member
Registered: 2014-09-17
Posts: 21

Re: Getting solarized colors right with urxvt, st, tmux and vim

First off, sorry about the double post.

I've also added the following...
To my ~/.bashrc:

export TERM="rxvt-unicode-256color"

And to ~/.tmux.conf:

set -g default-terminal "rxvt-unicode-256color"

Offline

#28 2014-10-26 22:25:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 20,423
Website

Re: Getting solarized colors right with urxvt, st, tmux and vim

Setting the default-terminal in tmux.conf should not be necessary.  Setting the TERM environment variable in your bashrc is likely the cause of your problems.  Remove that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#29 2014-10-26 22:30:29

svxiii
Member
Registered: 2014-09-17
Posts: 21

Re: Getting solarized colors right with urxvt, st, tmux and vim

Removed from both tmux.conf and bashrc
I'm still getting the same error: CSApprox skipped; terminal only has 16 colors, not 88/256

Last edited by svxiii (2014-10-26 22:33:27)

Offline

#30 2014-10-26 23:19:22

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Getting solarized colors right with urxvt, st, tmux and vim

Urxvt should automatically set TERM to rxvt-unicode-256color.

$ echo $TERM
rxvt-unicode-256color

Your .vimrc is setting the number of terminal colors to sixteen with the line, set t_Co=16. It should be:

set t_Co=256

In my .tmux.conf, I use this to set 256 colors:

set -g default-terminal "screen-256color"

Last edited by thisoldman (2014-10-26 23:19:43)

Offline

#31 2014-10-27 07:41:33

svxiii
Member
Registered: 2014-09-17
Posts: 21

Re: Getting solarized colors right with urxvt, st, tmux and vim

That does fix the initial problem, however, this is the result:
http://i.imgur.com/mrK2X2E.png

That's what solarized dark looks like with set t_Co=256.

With set t_Co=16 the colors were okay:

http://i.imgur.com/KTsZPeP.png

Last edited by svxiii (2014-10-27 07:42:42)

Offline

#32 2014-10-27 07:57:49

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Getting solarized colors right with urxvt, st, tmux and vim

I don't use the Solarized colorscheme or the CSApprox Vim plugin. But at this point, if I were you, I'd go with what works.

Offline

#33 2014-10-27 11:41:53

svxiii
Member
Registered: 2014-09-17
Posts: 21

Re: Getting solarized colors right with urxvt, st, tmux and vim

Ok, I fixed it. Removed CSApprox.vim from ~/.vim/plugin fixed the problem

Last edited by svxiii (2014-10-27 11:46:55)

Offline

#34 2015-01-21 20:22:33

Gruentee
Member
Registered: 2012-07-30
Posts: 3
Website

Re: Getting solarized colors right with urxvt, st, tmux and vim

Thanks! Worked well for me.


For every complex problem there is an answer that is clear, simple and wrong. ~ H.L. Mencken

Offline

#35 2017-12-18 13:25:54

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 111
Website

Re: Getting solarized colors right with urxvt, st, tmux and vim

Four colors are swapped for me, but everything seems OK in my daily use. I think that's because other configuration, like .Xresources, are set accordingly. However, I checked Ethan's values [1] and the first post in this thread (very helpful - thanks @drm00!) seems to be the one that swapped the colors. In Ethan's values, 0 is black, 8 is bright black, 7 is white and 15, bright white. These four values match my screenshot, but black is swapped with white in the first post, with the rest being exactly the same.

By the way, I managed to get the bold 0-7 colors right in tmux by exporting TERM as xterm-256color and aliasing tmux to "tmux -2".

[1] http://ethanschoonover.com/solarized#the-values

XAXj1S9.png

Offline

#36 2017-12-18 14:34:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 20,423
Website

Re: Getting solarized colors right with urxvt, st, tmux and vim

cemsbr wrote:

I managed to get the bold 0-7 colors right in tmux by exporting TERM...

And in doing so you broke several other things which will crop up over time leading you to post help requests here.  Please do not explicitly set TERM.  Do it right by setting the default-terminal setting in your tmux.conf


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#37 2017-12-18 22:20:31

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 111
Website

Re: Getting solarized colors right with urxvt, st, tmux and vim

Thanks for the advice. I set some configuration long ago and double checked them now. Actually, my gnome-terminal's TERM is xterm-256color by default and I have the default-terminal in tmux.conf set as screen-256color. However, the simpler script only shows the same colors when starting tmux with the -2 option. Otherwise, bold 0-7 looks like 8-15.

Offline

Board footer

Powered by FluxBB