Adjusting text colors in cygwin.
August 13, 2005 5:03 AM   Subscribe

How can I make the blue text brighter, in vim, in cygwin?

I've googled, but the only explanations I've found that I understand deal with changing X preferences, such as in .Xconfig. But I'm not using X (I could, but then I'd be using gvim, and that defaults to a white background, and I want to fuck with that even less). What file do I need to change to make the blue text lighter, so that I can see it against the black background?
posted by bingo to Computers & Internet (13 answers total) 1 user marked this as a favorite
Response by poster: Correction: I can run regular vim (not gvim) in X. But it still defaults to a white background. I want a good old fashioned console-type situation, but with readable text.
posted by bingo at 5:04 AM on August 13, 2005

~/.vimrc, where ~ is your home directory. I googled "vimrc settings", and I got enough pages that should provide you with hours of enlightenment... no, wait. I'm supposed to say "RTFM" here :)

The following should work, but note two things: I am using gvim at home and I am using vim at work under linux. I'm currently downloading vim for cygwin at home, but I have reason to believe that this will work.
posted by sleslie at 5:27 AM on August 13, 2005

ahem..."the following" being what I put in my .vimrc file:
colorscheme murphy
works for gvim at home on WinXp and for vim on Linux.
posted by sleslie at 5:31 AM on August 13, 2005

The very first thing every Cygwin user should do is drop the default stock windows "Command Prompt" and run rxvt. You don't need an X server running, rxvt is a dual mode program - it will use X11 if $DISPLAY is set, otherwise it will use native windows GDI calls.

For example, I use:
rxvt -geometry 130x60 -bg black -fg gray -cr white -fn "Lucida Console-11" -sr -sl 5000 -j -cr white -tn rxvt -e bash -li
Actually, I don't use that anymore - I moved most of those settings into ~/.Xdefaults (which rxvt will still read, even when it's not operating in X11 mode.)

From there you can go on to assign any arbitrary RGB color to each of the 16 standard color slots. Normal dark blue is 4, so for example rxvt -color4 "light steel blue" would select a different shade. This is all in the rxvt man page, just search for "color".

But the important part is that CMD.EXE sucks ass and nobody should ever use it.
posted by Rhomboid at 6:16 AM on August 13, 2005 [1 favorite]

Response by poster: Where can I find a list of other colorschemes like 'murphy'? Again, I have tried googling, but I'm lame or not finding it for some other reason.
posted by bingo at 7:07 AM on August 13, 2005

Response by poster: Found it: /usr/share/vim/vim63/colors/

Not that this will necessarily solve my problem, but it could.
posted by bingo at 7:23 AM on August 13, 2005

You could also type ":colorscheme " and use tab completion.

It's also important to tell Vim whether your terminal uses a dark or a light background color. If you find the blue in the default colorscheme too dark, it probably thinks you're using a white background. Try ":set background=dark".
posted by reynaert at 7:34 AM on August 13, 2005

Response by poster: Hmm...that's very interesting reynaert...but how do you set background to dark from within .vimrc (or better yet, from within .Xdefaults, so it can (I hope) affect the xterm too? I tried background=dark in .vimrc but it didn't go over well with the uh...compiler or something.
posted by bingo at 10:56 AM on August 13, 2005

Response by poster: ...actually, I don't mean xterm. I mean, whatever the cygwin terminal window is called. Because I have the same problem there. So setting up a default color scheme for vim is fine, but it doesn't help anything I do outside of vim. Which I know was not my original question, but I'm getting greedy.
posted by bingo at 11:03 AM on August 13, 2005

To make your terminal dark, try putting something like this in your .Xdefaults file:
XTerm*foreground: whiteXTerm*background: black
Now about Vim. I misunderstood your problem, I thought that you had a black background and Vim choosed colors that were to dark to read. So I might have misled you with my answer. The background option is not there to set the background color: it is there to tell Vim what the background color of your terminal is, so Vim can adjust the colorscheme. So if you have a white background, you should set it to "light", and if you have a black background, to "dark", and hopefully you get readable colors :)

So in your .vimrc you'd add something like this (assuming you also did the .Xdefaults thing and actually have a dark terminal now :):
set background=darkcolorscheme elflord
(I think you forgot the set keyword, and Vim complained about that.)
posted by reynaert at 1:22 PM on August 13, 2005

Response by poster: Actually, you understood my problem right the first time. What I was trying to say was: when I'm in the terminal, outside of vim, I have a black background, and text too dark to read. When I'm inside vim, then thanks to a new colorscheme and using ":set background=dark" in my .vimrc, it's no longer an issue. So what I'm basically asking for is the equivalent of ":set background=dark" for the .Xdefaults file. UNLESS, the cygwin terminal isn't affected by the .Xdefaults file...after all, it isn't really X, so is it really an xterm?
posted by bingo at 4:20 PM on August 13, 2005

Oh, it seems I'm being my usual confused self again :)

rxvt (I think the Cygwin terminal is rxvt) will read the .Xdefaults file on its own if it isn't running on X, so that shouldn't be a problem.

According to the man page (Colors and Graphics section) it is possible to tweak the colors. It seems the default blue is "Blue3", so something like this in your .Xdefaults should give you a brighter shade:
XTerm*color4: Blue2
This page lists the X color names. If the shade you want isn't in there, you could try looking for an rgb.txt file and adding it yourself, rxvt might notice it.
posted by reynaert at 6:01 PM on August 13, 2005

Response by poster: Well, the color of the prompt text in the terminal is actually a dark green. I tried adding XTerm*color2: LawnGreen to my .Xdefaults, but it had no effect.

Thanks for all your help, though...
posted by bingo at 8:29 AM on August 14, 2005

« Older perhaps even couch surfing would do   |   Do IM bouncers/proxies exist? Newer »
This thread is closed to new comments.