Go to file
Nicholas Beninato 7b1e60d5fd sublime settings
2020-01-03 03:53:04 -08:00
.gitignore ignore test/ 2014-06-23 16:08:29 -07:00
buildsuite Dropped dependency on Extended Regular Expressions, so the sed command now runs with OSX/BSD sed 2016-04-27 11:23:12 -07:00
LICENSE added LICENSE file and appropriate legalese elsewhere 2014-06-02 10:22:48 -07:00
LS_COLORS sublime settings 2020-01-03 03:53:04 -08:00
README.markdown Update README.markdown 2019-04-03 10:46:29 -05:00

Table of contents

LS_COLORS

This is a collection of extension:color mappings, suitable to use as your LS_COLORS environment variable. Most of them use the extended color map, described in the ECMA-48 document; in other words, you'll need a terminal with capabilities of displaying 256 colors.

As of this writing, around 300 different filetypes/extensions is supported. That's indeed a lot of extensions, but there's a lot more! Your help is greatly appreciated.

Fork this project on github, add the extensions you are missing, and send a pull request.

Some guidelines:

For files that usually ends up next to each other, like html, css and js, try to pick colors that fits in nicely together. Filetypes with multiple possible extensions, like htm and html, should have the same color.

What does it look like?

Here's a screenshot (font and minor color shades, of course, depend on terminal and its configuration):

Screenshot1

And another one:

Screenshot2

Installation

To install and use this file, put something like this in your shell resource file:

eval $( dircolors -b $HOME/.dircolors )

A quick way to install would be the following set of commands (assuming bash):

wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors
echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.bashrc
. $HOME/.bashrc

Arch Linux

Arch Linux users can install the lscolors-git package from the AUR for easy integration with bash, csh, or zsh.

zsh integration with Zplugin

There's a Zsh plugin manager Zplugin that nicely works with this repository – dircolors will be ran only once on each update. So dircolors will not read the LS_COLORS definitions and perform the computation each time a new shell is started, but instead only once per trapd00r/LS_COLORS install and per update (with zplugin update trapd00r/LS_COLORS) and only then generating the script c.zsh containing the dircolors output and after this just sourcing it when the shell starts, thus making the shell to startup faster:

zplugin ice atclone"dircolors -b LS_COLORS > c.zsh" atpull'%atclone' pick"c.zsh"
zplugin load trapd00r/LS_COLORS

ZSH syntax highlighting

zsh-syntax-highlighting-filetypes highlights file on the command-line in realtime, using these colors.

fish shell

eval ( dircolors --c-shell $HOME/.dircolors)

Place it in ~/.config/fish/config.fish or any *.fish* file inside ~/.config/fish/conf.d/ to be loaded.

Information for Developers

There's a library I've written that lets you use various LS COLORS on arbitrary files and directories. A simple implementation can be found here.

Using this, you can do

find $HOME -maxdepth 1  | ls_color

mpc search artist Laleh | ls_color

... and so on.

Legal

© Copyright 2014-2018 Magnus Woldrich.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Perl Artistic License for more details.

This program is free software: you can redistribute it and/or modify it under the terms of the Perl Artistic License as published by the Perl Foundation, either version 1.0 of the License, or (at your option) any later version.

You should have received a copy of the Perl Artistic License along with this program. If not, see http://www.perlfoundation.org/artistic_license_1_0.