When I ssh into a remote server from my terminal in Mac OS X Snow Leopard, I get all sorts of great context coloring. It makes it much easier to edit files in vi, gives good contrast when I ls -al, etc.

However, my local terminal doesn't have any of that context coloring. Is there a place I can choose those settings or some statements I can throw into my .profile file?

link|improve this question
feedback

1 Answer

up vote 3 down vote accepted

If you use bash, you can put this into your ~/.profile:

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

For vi, just enter :syntax on.


What are the color values?

The LSCOLORS specify the color values of the different items:

a = black
b = red
c = green
d = brown
e = blue
f = magenta
g = cyan
h = light gray
x = default

This works better for a dark background:

export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx

This works better for a bright background:

export LSCOLORS=ExFxCxDxBxegedabagacad

What are the positions of the colors?

Those are the positions of the values, in the order as they appear in LSCOLORS:

DIR
SYM_LINK
SOCKET
PIPE
EXE
BLOCK_SP
CHAR_SP
EXE_SUID
EXE_GUID
DIR_STICKY
DIR_WO_STICKY

Source

link|improve this answer
You have this answer macro'ed by now, right? – Daniel Beck Aug 17 '11 at 8:46
Huh? First time I've written an answer about that.. – slhck Aug 17 '11 at 8:56
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.