Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a problem with dark-blue color in vim or ls output. Because I'm using black background color, words colored in dark-blue are almost completely invisible. How can I address this problem?

share|improve this question
    
possible duplicate of Overriding the shade of color displayed –  Gilles May 16 '11 at 11:43
1  
The other thing you can do is change the colors themselves. None of the colors (even the 'dark' ones) are supposed to be unreadable on a black background. If you could specify what terminal you are using, more information could be provided if the linked question doesn't already help with this. –  Random832 May 16 '11 at 13:35
add comment

3 Answers

up vote 13 down vote accepted

You can modify the color theme of vim with the background option. Use

set background=dark

in your current session or set it permanent in your vimrc.

The output of ls is configured with /etc/DIR_COLORS. See the manpage for more information. The settings can be overwritten with a ~/.dir_colors (On Ubuntu: ~/.dircolors - see entry in ~/.bashrc) file in your home directory.

An entry like

 DIR 01;36 

will produce a more readable background with cyan.

share|improve this answer
    
Thanks, perfectly working for ls. –  user7477 May 16 '11 at 11:52
add comment

Rather than configure applications to avoid blue on black, I recommend configuring your terminal to make the blue more visible. Most terminal emulators have a setting for that. In xterm, there's an X resource:

XTerm.VT100.color4: CornflowerBlue

In other terminal emulators, look in the configuration file or dialog for color settings or themes.

There is a common control sequence to set the shade associated with a color number from the application: OSC 4 ; c ; spec BEL where OSC is ESC ], c is the color number and spec is a color spec such as #RGB.

printf %b '\e]4;4;#6495ed\a'  # set the blue shade to CornflowerBlue

A change by the application is only effective until the next terminal reset. If you use this method (only recommended if your terminal lacks a configuration mechanism), to make the change effectively persistent, append the color configuration escape sequence to your terminal's reset string (termcap: r1 string; terminfo: rs1 string).

See also Overriding the shade of color displayed, Can I set my local machine's terminal colors to use those of the machine I ssh into?.

share|improve this answer
add comment

If you inform vim that you are using a black background (or otherwise dark theme) it will lighten up all the colors so they are readable:

:set bg=dark
share|improve this answer
    
Thanks, it works like a charm for vim. –  user7477 May 16 '11 at 11:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.