vim & ls colors (dark blue over black.. what were they thinking?)

I like black backgrounds. Less radiation to the eyes, less energy consumed off earth.. Unfortunately most of the time (Browser, Office) we are forced to use white background. But at least terminals can be made black easily.

The problem with black terminal is the dark blue color, which really hurts to read over black background. The solution:

  • /bin/ls: (I hope you use the --colors alias by default..)
    LS_COLORS environment variable should contain di=01;34 (instead of the common di=00;34).
    In Fedora, CentOS it can be easily configured from  /etc/DIR_COLORS.xterm    DIR 00;34 -> DIR 01;34
  • Vim: (I hope you don't use another editor..)
    add set bg=dark to /etc/vim/vimrc or ~/.vimrc.
    alternatively add colorscheme: <your favorite colorscheme>, such as  evening.

7 thoughts on “vim & ls colors (dark blue over black.. what were they thinking?)

  1. Tomer Gabel

    Actually, most modern displays (read: LCDs) have backlights that are constantly on, so there isn\'t any tangible ecological benefit to black backgrounds.

    In fact, depending on the design of the LCD, it\'s entirely possible that a black background may be /more/ wasteful, because the crystals themselves need to be kept polarized in order to filter out the light...

  2. Grant Diffey

    But looking at a lightbulb 8hrs a day is tiring in itself.

    I also prefer white on black for the most part.

    xdark is a nice way to fix this using compiz to invert the color pallet of the entire displayserver

  3. Greg Swallow

    Ah, thanks. This was one of those mornings where I said, "enough!" and googled this just to fix the dark-blue-on-black background issue. I am not one of those guys who cares enough about every detail of his bashrc file to set his autocompletes and colors so this is just enough.

  4. sim

    Thanks for this, the office lighting on my laptop screen was making the dark blue on black ridiculous, something had to be done! A note for those running FreeBSD, your global vimrc file is in /usr/share/vim/vimrc

  5. Why do you need this?

    For years, I had been using a black background in my terminal windows and recently switched to a light brown background (Novell theme in OS X). I ended up finding this more pleasant and less straining for the eyes.

    I also used ls -F (no color) for a loooooong time, precisely to prevent "incompatibilities" with background images.

Leave a Reply

Your email address will not be published. Required fields are marked *