diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-12 21:22:20 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-12 21:22:20 +0000 |
commit | 5714953c514a5fea35dcd819caf1afef4d92a13b (patch) | |
tree | d930266c7043247119914fca1680a53b121d6685 /Completion/User/_colors | |
parent | 7f356602555c746d87eda64538a37c4ded76addb (diff) | |
download | zsh-5714953c514a5fea35dcd819caf1afef4d92a13b.tar.gz zsh-5714953c514a5fea35dcd819caf1afef4d92a13b.tar.xz zsh-5714953c514a5fea35dcd819caf1afef4d92a13b.zip |
Initial revision
Diffstat (limited to 'Completion/User/_colors')
-rw-r--r-- | Completion/User/_colors | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Completion/User/_colors b/Completion/User/_colors new file mode 100644 index 000000000..4e9ee2030 --- /dev/null +++ b/Completion/User/_colors @@ -0,0 +1,24 @@ +#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[@]" |