Originally nicoulaj at
Thank you very much Julien Nicoulaud!
Adapted by: Takeshi Banse <takebi@laafc.net>, public domain
I want to teach the $LS_COLORS as much as possible.
It is far from complete though. It can’t respect the file-type specific dircolor settings. Though it will try to respect the directory-type color (which is set by dircolors) by giving a special attention to the completion group name, but it’s still quite error-prone. Please be aware of.
% git clone https://github.com/hchbaw/list-colors.zsh.git
% cd list-colors.zsh
% $SHELL -uc ". ./list-colors.zsh && list-colors-zcompile ~/.dir_colors ~/.zsh/"
** Dumping and zcompiling for ~/.dir_colors
re-compiling ~/.zsh/list-colors-init.zwc: succeeded
** All done.
** Please update your .zshrc like this:
-- >8 --
fpath+=~/.zsh
autoload -Uz list-colors-init; list-colors-init
zstyle -e ':completion:*:default' list-colors list-colors list-colors-aux
# zstyle ':completion:*' group-name ''
# If you want to make it to respect directory-type color setting, you need
# to uncomment above line, please.
-- 8< --
Dumps out the list-colors.zsh’s variable which will be converted from
<dircolors file> (dircolors(5)
) and functions which will be actually
needed at the runtime under <directory to output> which is most likely in
$fpath
. <color file> is used to define the colors which maps dircolors
color to the another/cursor color.