Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

LSCOLORS for MacOS ls #10

Closed
logic opened this Issue · 7 comments

5 participants

Ed Marshall Sebastian Tramp Teo Ljungberg Phil Hudson Zev Averbach
Ed Marshall

I wasn't quite sure where to post this, so figured an issue off of your repository might be the most likely to be found by others. :) I took a bit of time today and roughly mirrored the base colors that your solarized theme for dircolors gives in OSX's LSCOLORS environment variable:

export LSCOLORS=gxfxbEaEBxxEhEhBaDaCaD

It's not nearly as comprehensive (you can't do file-type matching, for example), but it should be close, for those who don't want to replace ls with the GNU version.

Sebastian Tramp
Owner

hi logic, can you provide a screenshot here so that people can see how it looks like. I can link this issue from the README ...

Ed Marshall

Sure, no problem. Here are the default colors:

http://k.min.us/jX7u2.png

And here they are in a Solarized-esque version:

http://k.min.us/jT8h4.png

(Gallery link.)

Sebastian Tramp
Owner

Thanks, I've added a note to this issue ...

Sebastian Tramp seebi closed this
Teo Ljungberg

There is also another way.
You can install coreutils from homebrew and use that without replacing the OS X tools. Since they are installed with 'g' as the prefix
in your .bashrc, .profile or .bash_profile add this line
"
# Load GNU aliases
source /usr/local/Cellar/coreutils/8.12/aliases
"
and alias ls to GNUs alias
"
alias ls='gls --color=auto'
"
and of course add the aliases to coreutils before the ls alias
"
# Load GNU aliases
source /usr/local/Cellar/coreutils/8.12/aliases
"

Phil Hudson

coreutils can also be installed from the fink and MacPorts repositories (older alternatives to homebrew). Choose one and stick with it; don't mix them!

Zev Averbach

@teoljungberg is "aliases" meant to be a directory or file (8.23_1 has no such file/directory)? what should be done after adding these lines to .bashrc/.bash_profile to make this work?

Teo Ljungberg

@zevav It was when I wrote up that guideline, but after looking into it now I can see that it's not a directory. If you use homebrew as I used, and if you have /usr/local/bin in your path you have all of these in your PATH already. You can just alias ls to gls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.