1
0
Fork 0

°Zsh: Add some LS_COLORS

This commit is contained in:
tastytea 2022-03-31 18:27:51 +02:00
parent d42c5cb8bd
commit c9f68da170
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 20 additions and 0 deletions

View File

@ -133,6 +133,26 @@ elif command -v xterm > /dev/null; then
export TERMINAL="xterm"
fi
# Add some nice colors to ls output
function _gen_lscolor()
{
local color="${1}"
shift
local -a extensions=("${@}")
for ext in ${extensions}; do
print -n ":*.${ext}=${color}"
done
}
LS_COLORS="${LS_COLORS}$(_gen_lscolor "38;5;176" cpp cxx c++ c)"
LS_COLORS="${LS_COLORS}$(_gen_lscolor "38;5;110" hpp hxx h++ h)"
LS_COLORS="${LS_COLORS}$(_gen_lscolor "38;5;184" webp png jpg jpeg gif svg xcf)"
LS_COLORS="${LS_COLORS}$(_gen_lscolor "38;5;172" flac opus ogg oga mp3 m4a wav mid mod wma ac3 au)"
LS_COLORS="${LS_COLORS}$(_gen_lscolor "38;5;172" mkv webm ogv mp4 m4v avi mpeg mpg wmv flv mov 3gp)"
LS_COLORS="${LS_COLORS}$(_gen_lscolor "38;5;184" m3u m3u8 pls)"
export LS_COLORS
unfunction _gen_lscolor
# Host specific settings.
case $(hostname) in
schnibble | gaffer | localhost)