2018-12-09 00:49:37 +01:00
|
|
|
|
### Table of contents
|
|
|
|
|
* [LS_COLORS](#ls_colors)
|
2018-12-09 02:15:59 +01:00
|
|
|
|
* [What does it look like?](#what-does-it-look-like)
|
2018-12-09 00:49:37 +01:00
|
|
|
|
* [Installation](#installation)
|
|
|
|
|
* [Arch Linux](#arch-linux)
|
2019-01-31 09:24:09 +01:00
|
|
|
|
* [Zsh / Zplugin](#zsh-integration-with-zplugin)
|
2018-12-09 00:49:37 +01:00
|
|
|
|
* [ZSH syntax highlighting](#zsh-syntax-highlighting)
|
|
|
|
|
* [fish shell](#fish-shell)
|
|
|
|
|
* [Information for Developers](#information-for-developers)
|
|
|
|
|
* [Legal](#legal)
|
2011-04-09 19:14:13 +02:00
|
|
|
|
|
2018-12-09 00:49:37 +01:00
|
|
|
|
# LS_COLORS
|
2011-04-12 10:47:39 +02:00
|
|
|
|
This is a collection of extension:color mappings, suitable to use as your
|
2018-12-09 02:15:59 +01:00
|
|
|
|
`LS_COLORS` environment variable. Most of them use the extended color map,
|
2011-04-12 10:47:39 +02:00
|
|
|
|
described in the ECMA-48 document; in other words, you'll need a terminal
|
|
|
|
|
with capabilities of displaying 256 colors.
|
2011-04-09 19:14:13 +02:00
|
|
|
|
|
2011-04-12 10:47:39 +02:00
|
|
|
|
As of this writing, around 300 different filetypes/extensions is supported.
|
2011-09-17 09:46:53 +02:00
|
|
|
|
That's indeed a lot of extensions, but there's a lot more! Your help is greatly
|
|
|
|
|
appreciated.
|
2011-04-12 10:47:39 +02:00
|
|
|
|
|
2011-09-17 09:46:53 +02:00
|
|
|
|
Fork this project on github, add the extensions you are missing, and send a pull
|
|
|
|
|
request.
|
|
|
|
|
|
|
|
|
|
Some guidelines:
|
2011-04-12 10:47:39 +02:00
|
|
|
|
|
|
|
|
|
For files that usually ends up next to each other, like html, css and js,
|
2011-04-24 10:59:30 +02:00
|
|
|
|
try to pick colors that fits in nicely together. Filetypes with multiple
|
2011-04-12 10:47:39 +02:00
|
|
|
|
possible extensions, like htm and html, should have the same color.
|
|
|
|
|
|
2018-12-09 02:15:59 +01:00
|
|
|
|
# What does it look like?
|
2018-12-09 00:49:37 +01:00
|
|
|
|
Here's a screenshot _(font and minor color shades, of course, depend on terminal and its configuration)_:
|
|
|
|
|
|
|
|
|
|
![Screenshot1](http://orig07.deviantart.net/f59a/f/2016/087/a/e/ls_colors_1_by_trapd00r-d9wrdoa.png)
|
|
|
|
|
|
|
|
|
|
And another one:
|
|
|
|
|
|
|
|
|
|
![Screenshot2](http://orig02.deviantart.net/5c73/f/2016/087/4/8/ls_colors_2_by_trapd00r-d9wrdrq.png)
|
|
|
|
|
|
|
|
|
|
[0]: https://github.com/trapd00r/zsh-syntax-highlighting-filetypes
|
|
|
|
|
[1]: https://github.com/trapd00r/File-LsColor
|
|
|
|
|
[2]: https://github.com/trapd00r/File-LsColor/tree/master/bin
|
|
|
|
|
[3]: https://aur.archlinux.org/packages/lscolors-git
|
|
|
|
|
|
2018-11-09 20:15:44 +01:00
|
|
|
|
# Installation
|
2019-04-03 17:46:29 +02:00
|
|
|
|
To install and use this file, put something like this in your shell resource
|
2011-04-12 10:47:39 +02:00
|
|
|
|
file:
|
2018-12-11 17:23:19 +01:00
|
|
|
|
```shell
|
2019-03-11 08:31:41 +01:00
|
|
|
|
eval $( dircolors -b $HOME/.dircolors )
|
2018-12-08 23:51:31 +01:00
|
|
|
|
```
|
2011-04-09 19:14:13 +02:00
|
|
|
|
|
2012-11-21 17:54:42 +01:00
|
|
|
|
A quick way to install would be the following set of commands (assuming bash):
|
|
|
|
|
|
2018-12-11 17:23:19 +01:00
|
|
|
|
```shell
|
2012-11-21 17:54:42 +01:00
|
|
|
|
wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors
|
|
|
|
|
echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.bashrc
|
|
|
|
|
. $HOME/.bashrc
|
|
|
|
|
```
|
|
|
|
|
|
2018-12-09 00:49:37 +01:00
|
|
|
|
## Arch Linux
|
|
|
|
|
Arch Linux users can install the [`lscolors-git`][3] package from the AUR for easy
|
|
|
|
|
integration with bash, csh, or zsh.
|
|
|
|
|
|
2019-01-31 09:24:09 +01:00
|
|
|
|
## 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
|
|
|
|
|
```
|
|
|
|
|
|
2018-12-09 00:49:37 +01:00
|
|
|
|
## ZSH syntax highlighting
|
|
|
|
|
[zsh-syntax-highlighting-filetypes][0] highlights file on the command-line in
|
|
|
|
|
realtime, using these colors.
|
2018-12-08 23:51:31 +01:00
|
|
|
|
|
2018-12-09 00:49:37 +01:00
|
|
|
|
## fish shell
|
2018-12-11 17:23:19 +01:00
|
|
|
|
```fish
|
2019-03-11 08:31:41 +01:00
|
|
|
|
eval ( dircolors --c-shell $HOME/.dircolors)
|
2018-12-08 23:51:31 +01:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Place it in `~/.config/fish/config.fish` or any `*.fish*` file inside `~/.config/fish/conf.d/` to be loaded.
|
|
|
|
|
|
2018-12-09 00:01:16 +01:00
|
|
|
|
# Information for Developers
|
2011-06-20 23:31:20 +02:00
|
|
|
|
There's a [library][1] I've written that lets you use various LS COLORS on
|
2015-10-01 00:52:28 +02:00
|
|
|
|
arbitrary files and directories. A simple implementation can be found [here][2].
|
2011-04-09 19:14:13 +02:00
|
|
|
|
|
|
|
|
|
Using this, you can do
|
2018-12-11 17:23:19 +01:00
|
|
|
|
```shell
|
2018-12-09 00:49:37 +01:00
|
|
|
|
find $HOME -maxdepth 1 | ls_color
|
2011-04-09 19:14:13 +02:00
|
|
|
|
|
2018-12-09 00:49:37 +01:00
|
|
|
|
mpc search artist Laleh | ls_color
|
|
|
|
|
```
|
2011-04-09 19:14:13 +02:00
|
|
|
|
|
|
|
|
|
... and so on.
|
|
|
|
|
|
2018-12-09 00:01:16 +01:00
|
|
|
|
# Legal
|
2018-11-09 20:39:18 +01:00
|
|
|
|
© Copyright 2014-2018 Magnus Woldrich.
|
2014-06-04 18:08:16 +02:00
|
|
|
|
|
2014-06-02 19:22:48 +02:00
|
|
|
|
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>.
|