problems with vimdiff, syntax highlighting and colorscheme's

2,898 views
Skip to first unread message

Caleb Cushing

unread,
Feb 23, 2009, 12:13:35 AM2/23/09
to vim...@googlegroups.com
attached is a screenshot demonstrating the issue, next to Funtoo and
Regen2 there is text, however it can't be seen because of the colors,
I can't even highlight it to see what's underneath, I've tried a few
different colorschemes (all distributed with vim) and all I've seen
have this problem.

Any help getting this fixed would be appreciated. I don't mind if it
wants to highlight them a bit different so I can see what's the same..
I just want to be able to read the hidden text.

--
Caleb Cushing

http://xenoterracide.blogspot.com

vimdiff.png

Teemu Likonen

unread,
Feb 23, 2009, 1:55:03 AM2/23/09
to vim...@googlegroups.com
On 2009-02-23 00:13 (-0500), Caleb Cushing wrote:

> attached is a screenshot demonstrating the issue, next to Funtoo and
> Regen2 there is text, however it can't be seen because of the colors,
> I can't even highlight it to see what's underneath, I've tried a few
> different colorschemes (all distributed with vim) and all I've seen
> have this problem.

I've been using these settings:


highlight DiffAdd cterm=NONE ctermfg=bg ctermbg=Green gui=NONE guifg=bg guibg=Green
highlight DiffDelete cterm=NONE ctermfg=bg ctermbg=Red gui=NONE guifg=bg guibg=Red
highlight DiffChange cterm=NONE ctermfg=bg ctermbg=Yellow gui=NONE guifg=bg guibg=Yellow
highlight DiffText cterm=NONE ctermfg=bg ctermbg=Magenta gui=NONE guifg=bg guibg=Magenta

Caleb Cushing

unread,
Feb 23, 2009, 9:56:03 PM2/23/09
to vim...@googlegroups.com
> I've been using these settings:
>
>
> highlight DiffAdd cterm=NONE ctermfg=bg ctermbg=Green gui=NONE guifg=bg guibg=Green
> highlight DiffDelete cterm=NONE ctermfg=bg ctermbg=Red gui=NONE guifg=bg guibg=Red
> highlight DiffChange cterm=NONE ctermfg=bg ctermbg=Yellow gui=NONE guifg=bg guibg=Yellow
> highlight DiffText cterm=NONE ctermfg=bg ctermbg=Magenta gui=NONE guifg=bg guibg=Magenta

I should just add these to my vimrc and see if it helps?

pansz

unread,
Feb 24, 2009, 12:47:00 AM2/24/09
to vim...@googlegroups.com
Caleb Cushing 写道:

> I've tried a few
> different colorschemes (all distributed with vim) and all I've seen
> have this problem.
>
> Any help getting this fixed would be appreciated. I don't mind if it
> wants to highlight them a bit different so I can see what's the same..
> I just want to be able to read the hidden text.

Generally, Bram (the maintainer of vim) will not include new
colorschemes in vim, I had made a request several years ago and he
refused. IMO most colorschemes in the standard vim distribution are
buggy (to some extent).

But you're strongly recommended to try the colorscheme on vim.sf.net,
most top-rated colorschemes has good support of diff mode.

See this:

http://vim.sourceforge.net/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search

Caleb Cushing

unread,
Feb 24, 2009, 1:16:54 AM2/24/09
to vim...@googlegroups.com
On Tue, Feb 24, 2009 at 12:47 AM, pansz <pans...@routon.com> wrote:
> Generally, Bram (the maintainer of vim) will not include new
> colorschemes in vim, I had made a request several years ago and he
> refused. IMO most colorschemes in the standard vim distribution are
> buggy (to some extent).

bugs should be fixed. I do infact see this as a bug. I don't care that
bram won't include new colorschemes but if the existing ones are
broken then should be fixed.

I hate going through colorschemes though, does anyone have a good one
for konsole w/ dark/black background use? I realize it's a bit of a
preference but I can still ask for suggestions.

Teemu Likonen

unread,
Feb 24, 2009, 2:08:10 AM2/24/09
to vim...@googlegroups.com
On 2009-02-24 01:16 (-0500), Caleb Cushing wrote:

> I hate going through colorschemes though, does anyone have a good one
> for konsole w/ dark/black background use? I realize it's a bit of a
> preference but I can still ask for suggestions.

Here is my definition of "good one". I call it ~/.vim/colors/dtw.vim and
it is mostly the default colors except bugs fixed. It uses similar
colors with GUI too.

set background=dark
highlight clear
if exists('syntax_on')
syntax reset
endif

let g:colors_name = expand('<sfile>:t:r')

highlight Normal ctermfg=Gray ctermbg=Black guifg=Gray guibg=Black

highlight TabLineSel cterm=NONE ctermfg=fg ctermbg=Blue gui=NONE guifg=fg guibg=Blue
highlight TabLine cterm=NONE ctermfg=bg ctermbg=fg gui=NONE guifg=bg guibg=fg
highlight TabLineFill cterm=NONE ctermfg=bg ctermbg=fg gui=NONE guifg=bg guibg=fg
highlight Title cterm=NONE ctermfg=Red gui=NONE guifg=Red

highlight MatchParen cterm=NONE ctermfg=Red ctermbg=bg gui=NONE guifg=Red guibg=bg

highlight FoldColumn cterm=NONE ctermfg=bg ctermbg=fg gui=NONE guifg=bg guibg=fg
highlight Folded cterm=NONE ctermfg=Cyan ctermbg=bg gui=NONE guifg=Cyan guibg=bg

highlight StatusLine cterm=NONE ctermfg=fg ctermbg=Blue gui=NONE guifg=fg guibg=Blue
highlight StatusLineNC cterm=NONE ctermfg=bg ctermbg=fg gui=NONE guifg=bg guibg=fg

highlight DiffAdd cterm=NONE ctermfg=bg ctermbg=Green gui=NONE guifg=bg guibg=Green
highlight DiffDelete cterm=NONE ctermfg=bg ctermbg=Red gui=NONE guifg=bg guibg=Red
highlight DiffChange cterm=NONE ctermfg=bg ctermbg=Yellow gui=NONE guifg=bg guibg=Yellow
highlight DiffText cterm=NONE ctermfg=bg ctermbg=Magenta gui=NONE guifg=bg guibg=Magenta

highlight Pmenu cterm=NONE ctermfg=bg ctermbg=White gui=NONE guifg=bg guibg=White
highlight PmenuSel cterm=NONE ctermfg=White ctermbg=Blue gui=NONE guifg=White guibg=Blue
highlight PmenuSbar cterm=NONE ctermfg=Yellow ctermbg=Yellow gui=NONE guifg=Yellow guibg=Yellow
highlight PmenuThumb cterm=NONE ctermfg=bg ctermbg=bg gui=NONE guifg=bg guibg=bg

highlight SpellBad cterm=underline ctermfg=DarkRed ctermbg=bg gui=undercurl guisp=Red

John Beckett

unread,
Feb 24, 2009, 5:48:21 PM2/24/09
to vim...@googlegroups.com
Caleb Cushing wrote:
> I hate going through colorschemes though, does anyone have a
> good one for konsole w/ dark/black background use? I realize
> it's a bit of a preference but I can still ask for suggestions.

Here is a good method to investigate color schemes:
http://vim.wikia.com/wiki/Switch_color_schemes

It's a little lengthy but it works well (I rewrote it a couple of months
ago and merged several ideas to a new script). I put my choice (elflord)
as the example at the top!

John

Tony Mechelynck

unread,
Feb 24, 2009, 11:46:12 PM2/24/09
to vim...@googlegroups.com
On 24/02/09 03:56, Caleb Cushing wrote:
>> I've been using these settings:
>>
>>
>> highlight DiffAdd cterm=NONE ctermfg=bg ctermbg=Green gui=NONE guifg=bg guibg=Green
>> highlight DiffDelete cterm=NONE ctermfg=bg ctermbg=Red gui=NONE guifg=bg guibg=Red
>> highlight DiffChange cterm=NONE ctermfg=bg ctermbg=Yellow gui=NONE guifg=bg guibg=Yellow
>> highlight DiffText cterm=NONE ctermfg=bg ctermbg=Magenta gui=NONE guifg=bg guibg=Magenta
>
> I should just add these to my vimrc and see if it helps?
>
>

Well, you can (see after the horizontal dividing line below though), but
it might perhaps be better to start a custom colorscheme with them (so
you don't lose your "special highlights" if you try another colorscheme
then want to come back). You don't have to define every single default
highlight group in your colorscheme, you can build upon the default
colors, changing only the nondefault ones.

I'm attaching the colorscheme I use (mostly, but not only, in the GUI):
it isn't for general use, but you might view it as an example of a
colorscheme setting most colors to the default (hence its name). You can
compare it with the "default" colorscheme,
$VIMRUNTIME/colors/default.vim, which resets _all_ colors to the
defaults but defines none of them.

In any case, if the colors set for the Diff<something> highlight groups
by the commands at top aren't to your liking, then (for Console mode)
tweak the cterm= ctermfg= ctermbg= arguments (or, for GUI mode, the
correspoding gui= guifg= guibg= ones).

-----------------------------------------------------------------------

Another possibility would be, rather than adding the 4 ":highlight"
commands at top, to search the existing colorschemes for one with
support of diff highlights in Console mode, maybe as follows:

:0verbose vimgrep /\<hi\%[ghlight]\s\+Diff/ $VIMRUNTIME/colors/*.vim

which will select ":highlight" commands for those diff-something groups.
Then find a colorscheme in the lot which changes the cterm= ctermfg=
ctermbg= settings (or at least one of them) for those groups. You may
have to try several such schemes before you find one which you like.
After running the vimgrep command, ":cnext" finds the next hit,
":cnfile" goes to the next file; similarly ":cprev" ":cpfile" ":cfirst"
":clast" etc.

Note: At least one of them has distinct ":hi" lines for cterm and GUI,
which sometimes means two different ones for the same grooup.


Best regards,
Tony.
--
"Microwave oven? Whaddya mean, it's a microwave oven? I've been
watching Channel 4 on the thing for two weeks."

almost-default.vim

pansz

unread,
Feb 25, 2009, 12:46:44 AM2/25/09
to vim...@googlegroups.com
Caleb Cushing 写道:

>
> I hate going through colorschemes though, does anyone have a good one
> for konsole w/ dark/black background use? I realize it's a bit of a
> preference but I can still ask for suggestions.

It depends on how you define "good". Everyone had their own taste.

For me this one is the best, which contains both dark and light
background schemes and I use it only in Konsole.

http://vim.sourceforge.net/scripts/script.php?script_id=760

You may or may not like it, that's up to you for choice.

Anton Sharonov

unread,
Feb 25, 2009, 1:36:59 AM2/25/09
to vim...@googlegroups.com
>> I hate going through colorschemes though, does anyone have a good one
>> for konsole w/ dark/black background use?

> http://vim.sourceforge.net/scripts/script.php?script_id=760

+1 for peaksea

(Though I use it only with light background, I think it is worst to
check how good it's "dark side" is - in the hope that it is equally
well balanced as a light one.)

--
Anton

Caleb Cushing

unread,
Feb 25, 2009, 3:13:45 AM2/25/09
to vim...@googlegroups.com
On Wed, Feb 25, 2009 at 12:46 AM, pansz <pans...@routon.com> wrote:
> It depends on how you define "good". Everyone had their own taste.
>
> For me this one is the best, which contains both dark and light
> background schemes and I use it only in Konsole.
>
> http://vim.sourceforge.net/scripts/script.php?script_id=760
>
> You may or may not like it, that's up to you for choice.

The fact that it says it supports 256 colors in konsole has me sold
(without looking) most console colorschemes are set for 16 colors, you
know... because that's all anything supports right? I mean I've seen
mplayer play full color movies without X but hey...

Matt Wozniski

unread,
Feb 25, 2009, 10:21:39 AM2/25/09
to vim...@googlegroups.com
On 2/25/09, Caleb Cushing wrote:

>
> On Wed, Feb 25, 2009 at 12:46 AM, pansz wrote:
> > It depends on how you define "good". Everyone had their own taste.
> >
> > For me this one is the best, which contains both dark and light
> > background schemes and I use it only in Konsole.
> >
> > http://vim.sourceforge.net/scripts/script.php?script_id=760
> >
> > You may or may not like it, that's up to you for choice.
>
>
> The fact that it says it supports 256 colors in konsole has me sold
> (without looking) most console colorschemes are set for 16 colors, you
> know... because that's all anything supports right? I mean I've seen
> mplayer play full color movies without X but hey...

CSApprox.vim ( http://www.vim.org/scripts/script.php?script_id=2390 )
is a script that tries to make colorschemes look as close as possible
in 88- or 256-color terminal vim to how they look in gvim, and it
usually does a very good job. Plus, I'm the author, so if you need
support you know who to ask. I wrote it with the aim of getting
around that nasty little problem that terminals support many more
colors than colorscheme authors tend to use.

~Matt

Caleb Cushing

unread,
Feb 25, 2009, 1:07:50 PM2/25/09
to vim...@googlegroups.com
On Wed, Feb 25, 2009 at 10:21 AM, Matt Wozniski <m...@drexel.edu> wrote:
> CSApprox.vim ( http://www.vim.org/scripts/script.php?script_id=2390 )
> is a script that tries to make colorschemes look as close as possible
> in 88- or 256-color terminal vim to how they look in gvim, and it
> usually does a very good job.  Plus, I'm the author, so if you need
> support you know who to ask.  I wrote it with the aim of getting
> around that nasty little problem that terminals support many more
> colors than colorscheme authors tend to use.

I'll check it out. peaksea's pretty cool my 1 complaint thus far is
its 'dark grey' background. is it possible to override this in 1 or 2
lines to tell it to be black? every time I see the grey my eyes want
to think there's something wrong... it just seems weird to me.. like
my eyes are only partially open..

pansz

unread,
Feb 25, 2009, 7:54:12 PM2/25/09
to vim...@googlegroups.com
Caleb Cushing 写道:
That was in the FAQ list, but now removed. simply open the script and
search the text 'Normal' and see some line with guibg=#202020, you can
change it into guibg=#000000 which is pure black.


btw: I'm the author and you'll know who you can ask when you've got any
problems.

Caleb Cushing

unread,
Feb 26, 2009, 1:36:25 AM2/26/09
to vim...@googlegroups.com
On Wed, Feb 25, 2009 at 7:54 PM, pansz <pans...@routon.com> wrote:
> That was in the FAQ list, but now removed. simply open the script and
> search the text 'Normal' and see some line with guibg=#202020, you can
> change it into guibg=#000000 which is pure black.
>

I changed line 258 to read as follows (I'm using background="dark" and console)

hi Normal guifg=#d0d0d0 guibg=#000000 gui=NONE

closed and reopened vim just to be sure... I still seem to be getting
a greyish background (also :source peaksea.vim :set background=dark)

pansz

unread,
Feb 26, 2009, 2:13:11 AM2/26/09
to vim...@googlegroups.com
Caleb Cushing 写道:

That's for gui, for console you could find the following line:

hi Normal ctermfg=252 ctermbg=234 cterm=NONE

and change the ctermbg=234 into ctermbg=232, (232 is black and 255 is
white, 234 is somewhere between black and white)

KF

unread,
Feb 26, 2009, 11:28:52 AM2/26/09
to vim_use

Tony Mechelynck

unread,
Feb 27, 2009, 1:04:52 AM2/27/09
to vim...@googlegroups.com

Xterm is not "without X", it just adds a buffer layer between the X
server and your text-based application. I have yet to see a "true" non-X
console, such as the ones you can access in runlevel 3 (multiuser with
network but no X) and into which you drop from X by hitting Alt-Ctrl-F2
to Alt-Ctrl-F6 (and out of by Alt-Ctrl-F7), which could display more
than 8 background and 16 foreground colors with blink, or 16*16 without
blink.

Best regards,
Tony.
--
No children may attend school with their breath smelling of "wild onions."
[real standing law in West Virginia, United States of America]

bill lam

unread,
Feb 27, 2009, 1:18:45 AM2/27/09
to vim...@googlegroups.com
On Fri, 27 Feb 2009, Tony Mechelynck wrote:
> Xterm is not "without X", it just adds a buffer layer between the X
> server and your text-based application. I have yet to see a "true" non-X
> console, such as the ones you can access in runlevel 3 (multiuser with
> network but no X) and into which you drop from X by hitting Alt-Ctrl-F2
> to Alt-Ctrl-F6 (and out of by Alt-Ctrl-F7), which could display more
> than 8 background and 16 foreground colors with blink, or 16*16 without
> blink.

I've tried fbcon (a console under framebuffer), of course you have to
boot into framebuffer to use it.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩245 元稹 行宮
寥落古行宮 宮花寂寞紅 白頭宮女在 閒坐說玄宗

Tony Mechelynck

unread,
Feb 27, 2009, 1:33:27 AM2/27/09
to vim...@googlegroups.com
On 27/02/09 07:18, bill lam wrote:
> On Fri, 27 Feb 2009, Tony Mechelynck wrote:
>> Xterm is not "without X", it just adds a buffer layer between the X
>> server and your text-based application. I have yet to see a "true" non-X
>> console, such as the ones you can access in runlevel 3 (multiuser with
>> network but no X) and into which you drop from X by hitting Alt-Ctrl-F2
>> to Alt-Ctrl-F6 (and out of by Alt-Ctrl-F7), which could display more
>> than 8 background and 16 foreground colors with blink, or 16*16 without
>> blink.
>
> I've tried fbcon (a console under framebuffer), of course you have to
> boot into framebuffer to use it.
>

I've used framebuffer before (under RedHat) and I don't like it, it sets
too much constraints on what kind of X settings I can use. Here (under
SuSE 11.1), my video hardwware is supported by "standard" drivers and I
like that better. But I haven't yet found how to boot the PAE kernel
over GRUB into other than 80 columns, 25 lines, 16 colours (or maybe 8
bg, 16 fg, blink).


Best regards,
Tony.
--
Ban the bomb. Save the world for conventional warfare.

Matt Wozniski

unread,
Feb 27, 2009, 8:26:20 AM2/27/09
to vim...@googlegroups.com

Regardless of whether you like them or not, framebuffer consoles can
display millions of colors, mplayer can play full color movies in them
(though it looks somewhat strange to see an mplayer window with no
window manager decorations pop up), and I've heard that fbiterm (a
terminal emulator that runs in the framebuffer console) can support
256 colors.

~Matt

Reply all
Reply to author
Forward
0 new messages