diff options
author | Aaron LI <aaronly.me@gmail.com> | 2016-04-30 15:13:55 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@gmail.com> | 2016-04-30 15:13:55 +0800 |
commit | c381c0c531a78ff4b1a1907c10da4ff54a112f0a (patch) | |
tree | b194beb791c36b31fd1f3333d2f20f07462fe516 /_zsh/20-colors.zsh | |
parent | 3d6f015f851398d0ce1e509cd6fd88e74c7626f6 (diff) | |
download | dotfiles-c381c0c531a78ff4b1a1907c10da4ff54a112f0a.tar.bz2 |
_zsh: simplify initialization; order by perfix
Diffstat (limited to '_zsh/20-colors.zsh')
-rw-r--r-- | _zsh/20-colors.zsh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/_zsh/20-colors.zsh b/_zsh/20-colors.zsh new file mode 100644 index 0000000..b9a4797 --- /dev/null +++ b/_zsh/20-colors.zsh @@ -0,0 +1,27 @@ +# +# zsh/colors.sh +# + +autoload -U colors && colors + +# The variables are wrapped in %{%}. This should be the case for every +# variable that does not contain space. +for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do + eval PR_$COLOR='%{$fg_no_bold[${(L)COLOR}]%}' + eval PR_BOLD_$COLOR='%{$fg_bold[${(L)COLOR}]%}' +done + +eval RESET='$reset_color' +export PR_RED PR_GREEN PR_YELLOW PR_BLUE PR_WHITE PR_BLACK +export PR_BOLD_RED PR_BOLD_GREEN PR_BOLD_YELLOW PR_BOLD_BLUE +export PR_BOLD_WHITE PR_BOLD_BLACK + +# colors for BSD ls +if [[ -n "${IS_BSD}" ]]; then + export CLICOLOR=1 + #export LSCOLORS=Gxfxcxdxbxegedabagacad + export LSCOLORS=exfxcxdxbxegedabagacad +fi + + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # |