-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
zcolors.plugin.zsh
41 lines (34 loc) · 1.04 KB
/
zcolors.plugin.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/zsh
zcolors.plugin() {
emulate -L zsh
setopt extendedglob warncreateglobal
autoload -Uz add-zsh-hook
autoload -Uz ${${(%):-%x}:P:h}/functions/[[:alpha:]]*~*.zwc
typeset -g zle_highlight=(
isearch:fg=black,bg=11 # bright yellow
paste:bold
region:bg=blue,fg=15 # bright white
special:fg=14 # bright cyan
suffix:bg=blue,fg=15 # bright white
)
export GREP_COLOR='30;103' # black on bright yellow
export GREP_COLORS="mt=$GREP_COLOR" # GNU grep >= 3
if whence -p less > /dev/null && (( ${${=$( less -V )}[2]} >= 581 )); then
export -T LESS less ' '
# [S]earch results: blac[k] on bright [Y]ellow
# [P]rompt: bright [W]hite on [b]lue
less+=( --use-color '-DSkY$DPWb' )
fi
add-zsh-hook precmd .zcolors.precmd
.zcolors.precmd() {
add-zsh-hook -d precmd .zcolors.precmd
unfunction .zcolors.precmd
zmodload -F zsh/parameter p:saliases
ls_colors+=( '*.'${(@k)^saliases}"=$lscolors[sg]" )
}
}
{
zcolors.plugin "$@"
} always {
unfunction zcolors.plugin
}