Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

functions/Misc/prompt-colors



I think this is usefull for prompts

-- 
Signature invent in progress 22% ##........
# Quote colors with %{ and %}
# Usefull for prompts

autoload colors
colors

typeset -Hg pr_reset_color pr_bold_color
pr_reset_color="%{$reset_color%}"
pr_bold_color="%{$bold_color%}"

local k

# Foreground
typeset -AHg pr_fg pr_fg_bold pr_fg_no_bold
for k in ${(k)fg}; do
    pr_fg[$k]="%{$fg[k]%}"
    pr_fg_bold[$k]="%{$fg_bold[$k]%}"
    pr_fg_no_bold[$k]="%{$fg_no_bold[$k]%}"
done

# Background
typeset -AHg pr_bg pr_bg_bold pr_bg_no_bold
for k in ${(k)fg}; do
    pr_bg[$k]="%{$pr_bg[$k]%}"
    pr_bg_bold[$k]="%{$bg_bold[$k]%}"
    pr_bg_no_bold[$k]="%{$bg_no_bold[$k]%}"
done


Messages sorted by: Reverse Date, Date, Thread, Author