Changing directory color with zsh + Prezto

I use Prezto + zsh as my shell. I would like to change the color of the directories when I ls my directory. For example, here is what I have now:

My crappy ls listing

Obviously, this is not funny, since Im can hardly read my catalogs, because blue is so dark. I'd like to change it to white or orange or something lighter.

This blue color is directory specific only. Files are displayed in good white text. Where and what settings should I find to change this?

+6
source share
2 answers

The answer depends on your ls . BSD ls uses the LSCOLORS environment LSCOLORS ; coreutils ls uses LS_COLORS instead. See your manual page.

The utility Prezto module uses dircolors (if available) to adjust the colors of coreutils ls , which also happens with coreutils. Therefore, if you have coreutils, you can use dircolors to provide human-readable color definitions. See the dircolors page for more information. Prezto reads from $HOME/.dir_colors by default, otherwise it just uses the default colors defined by dircolors . You can, of course, specify other locations by editing on top of Prezto.

For BSD ls, there is probably no utility comparable to dircolors , so you need to manually define LSCOLORS . See the ENVIRONMENT section man page in its format, which should be pretty clear. Example: LSCOLORS='exfxcxdxbxGxDxabagacad' , used by default by Prezto. For it to take effect, put it in runcoms after downloading the utility utility Prezto.

+2
source

An easier way to do this is to change the color scheme of your terminal. For example, if you are using iTerm2 on a Mac, then:

  • Launch iTerm2
  • type CMD+i
  • On the Colors tab, change the Blue setting (and possibly the Vivid equivalent)
  • On the General tab, click Copy current settings to selected profile

If you want to return to the default values, you can always select a value from the "Color Presets ..." drop-down list on the "Colors" tab.

Make the equivalent in your favorite terminal if you are not using iTerm2 on a Mac.

+11
source

All Articles