You are not logged in.

#1 2012-04-14 17:29:18

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

ViM colorschemes and .Xdefaults colors

I am wondering what to do with my ViM colorschemes and the color definitions in .Xdefaults. Since some ViM colorschemes inherit the terminal colors set in .Xdefaults, the colors look horribly off. For instance, I wanted to install a colorscheme to use when I edit LaTeX code for better contrasts. I looked at http://vimcolorschemetest.googlecode.co … x-tex.html and found BlackSea to my liking. After installing however, my ViM does not look like that at all...

So what do you do to properly set your ViM colorschemes? Do you just adjust your .Xdefaults to match the colorscheme (or vice versa)?

Offline

#2 2012-04-14 17:58:05

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

Re: ViM colorschemes and .Xdefaults colors

I'm not familiar with BlackSea, but most vim color schemes have conditional tests that check the terminal color depth.

The picture you liked was probably the 256 color version.  If your terminal is not set up to support 256 colors, then it will go to the 8 color setting.  In the 8 color setting it uses your colors from your .Xdefaults, but in 256 color mode, it sets it's own rgb colors.

So, don't worry about your .Xdefaults, just use the 256 color mode.

What terminal are you using?  What's in your .vimrc?  You may need this line in .vimrc

set term=xterm-256color

I have that right before I set the colorscheme.

EDIT: I just looked at blacksea.vim.  There is no conditional test, it just assumes 256 colors.  If you want it to look like the linked image, then set 256 color mode.

Last edited by Trilby (2012-04-14 18:04:15)


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

Offline

#3 2012-04-14 18:00:08

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: ViM colorschemes and .Xdefaults colors

Many colorschemes for Vim need dedicated Xdefaults settings to look exactly like in the screenshots... There are color configs for Vim that work somehow beyond the scope of terminal settings (I made up one myself), as they make use of colour range 16--253 (in some cases taking only foreground and background settings from Xdefaults). However, they make Vim stand out from the rest of terminal applications. So if you prefer a unified look, you may want to look around for a good Xdefaults / Vim combo.

Edit: A terminal independent way of settings 256 colours would be

set t_Co=256

Some themes have been created to adjust the spectrum automatically when used in a 256 colour capable terminal and 8 colour only Linux console.

Last edited by bohoomil (2012-04-14 18:13:52)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#4 2012-04-14 21:34:26

rockin turtle
Member
From: Montana, USA
Registered: 2009-10-22
Posts: 227

Re: ViM colorschemes and .Xdefaults colors

Use gvim.

The 'BlackSea' file you referenced even says in a comment near the start that:

" This is a dark version/opposite of "seashell". The cterm version of this is
" very similar to "evening".

What this means is that the colors shown are for gvim.  If you run vim from a terminal (such as xterm or urxvt etc.) then the color scheme will be similar to the 'evening' colorscheme (provided your .Xdefaults/.Xresources file is set reasonably).

It is possible to set up 'terminal' vim to do what you want, but it is complicated.

Offline

#5 2012-04-15 10:09:00

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

Re: ViM colorschemes and .Xdefaults colors

@Trilby:
I use URxvt with 256 color support. smile

@bohoohmil:
Thanks, I guess I am going to do just that.

@rockin turtle:
Yeah, I was thinking about using gVim; I just don't like that it is not running in a terminal... all those GUI-bars I find annoying.

Offline

#6 2012-04-15 10:19:46

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

Re: ViM colorschemes and .Xdefaults colors

There are vim plugins to convert gui colorschemes to the terminal: 'community/vim-guicolorscheme' and 'aur/vim-csapprox'.  I have not tried them.  Some instructions on their use are at http://vim.wikia.com/wiki/Using_GUI_col … a_terminal.

Offline

Board footer

Powered by FluxBB