Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 4 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

share|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
add comment

Your Answer

 
discard

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

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