You are not logged in.

#1 2012-12-15 13:29:23

daGrevis
Member
From: Riga, Latvia
Registered: 2011-10-16
Posts: 81
Website

Bad colors in Vim

Hello,

My problem is that colors for Molokai color-schema in Vim doesn't look exactly the same as in screenshot. Molokai isn't the only color-scheme for me that looks kinda weird and I think that's somehow related to terminal support for 256 colors.
I'm using `rxvt-unicode-256xresources` from AUR instead of official `rxvt-unicode` from repo. I have `set t_Co=256` in `.vimrc`. I have Molokai theme for Vim and for terminal (in `.Xresources`) as well, but still it looks kinda different.

http://i.imgur.com/12w08.jpg

Need advice to fix colors, thanks! smile

Edit: Screenshot shows all correctly (less or more), but actually it's much worse. Weirdly, but taking screenshots somehow fixed it?

Moderator edit: The included image is too big. Reduced to url.

Last edited by bernarcher (2012-12-15 20:08:05)

Offline

#2 2012-12-15 16:06:40

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: Bad colors in Vim

Check if the colourscheme uses colour 0..15, if it does, the colours will vary depending on what you have defined for 0..15 in your TE. To keep the colours (more likely to be) persistent across systems, only use colours >15 in the colourscheme.

Last edited by Mr.Elendig (2012-12-15 16:07:00)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2012-12-17 08:41:39

daGrevis
Member
From: Riga, Latvia
Registered: 2011-10-16
Posts: 81
Website

Re: Bad colors in Vim

No, molokai.vim doesn't use 0..15.

https://github.com/tomasr/molokai
http://winterdom.com/2008/08/molokaiforvim

On my other computer the difference is much worse! In Vim green color is electro-green, but in the screenshot I see it as leaf-green.

Offline

#4 2012-12-17 09:04:10

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

Re: Bad colors in Vim

daGrevis wrote:

On my other computer the difference is much worse! In Vim green color is electro-green, but in the screenshot I see it as leaf-green.

Could be your .Xresources ?


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#5 2012-12-17 09:14:51

daGrevis
Member
From: Riga, Latvia
Registered: 2011-10-16
Posts: 81
Website

Re: Bad colors in Vim

No because I just tried to remove all colors set in my `.Xresources` and that didn't help.

Here is my conf if that helps anyhow. https://github.com/daGrevis/Dotfiles

Offline

#6 2012-12-17 11:12:04

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

Re: Bad colors in Vim

There appear to be some big differences, to my eye, between the gui colors and the cterm colors.

:hi Function
Function       xxx ctermfg=118 guifg=#A6E22E

Color 118 is #87FF00.  The cterm color 154, #AFFF00, is a better match to my eye.  I edited a copy of the molokai color scheme, and toned down the electric green with:

:%s/=118/=154/g

I have spent some time coming up with a custom color scheme for vim in xterm and urxvt.  I now always add this boiler plate to color scheme files so I don't have to remember these useful tips:

" ----------------------------------------------------------------------
" To test, use
"   :so %
"
" To see the current color setting for an individual syntax item:
"   :hi Cursor
"
" To see all the highlight syntax groups:
"   :so $VIMRUNTIME/syntax/hitest.vim

" Useful help pages:
"   :he group-name
"   :he highlight-groups

" Useful plugin:
"   xterm-color-table.vim
"       http://www.vim.org/scripts/script.php?script_id=3412
"    Usage:
"       :XtermColorTable
" ---------------------------------------------------------------------

The XtermColorTable plugin works in urxvt.  That plugin shows a table in a vim window with the cterm color numbers next to blocks of the color.  The display of RGB values can then be toggled using the mouse to select a color block or with single key commands.

Edited for spelling error correction.

Last edited by thisoldman (2012-12-17 11:21:04)

Offline

#7 2012-12-24 11:09:52

daGrevis
Member
From: Riga, Latvia
Registered: 2011-10-16
Posts: 81
Website

Re: Bad colors in Vim

Thanks for you snippet! Currently I'm using Monokai that's converted from TextMate to Vim w/ coloration; it works!

Offline

Board footer

Powered by FluxBB