1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-03 13:56:03 +02:00
zsh/Completion/User/_colors
1999-08-12 21:22:20 +00:00

25 lines
487 B
Plaintext

#autoload
if (( ! $+_color_cache )); then
local file
# Cache of color names doesn't exist yet, create it.
if [[ -f /usr/lib/X11/rgb.txt ]]; then
file=/usr/lib/X11/rgb.txt
elif [[ -f /usr/local/lib/X11/rgb.txt ]]; then
file=/usr/local/lib/X11/rgb.txt
fi
if [[ -n "$file" ]]; then
_color_cache=( "${(@)${(@f)$(< $file)}[2,-1]##* }" )
else
# Stupid default value.
_color_cache=(white black gray red blue green)
fi
fi
compadd - "$_color_cache[@]"