module "highlight": check available colors

This commit is contained in:
Alexander Gehrke (crater2150) 2016-01-05 03:51:22 +01:00
parent 3ec2a2f127
commit fe1a5290fe

View file

@ -1,12 +1,14 @@
. $MPATH/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh . $MPATH/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets cursor pattern) ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
if [[ "`tput colors`" == "256" ]] || [[ "`tput colors`" == "88" ]] ; then
ZSH_HIGHLIGHT_STYLES[command]='fg=74' ZSH_HIGHLIGHT_STYLES[command]='fg=74'
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=74' ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=74'
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=74' ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=74'
ZSH_HIGHLIGHT_STYLES[function]='fg=74' ZSH_HIGHLIGHT_STYLES[function]='fg=74'
ZSH_HIGHLIGHT_STYLES[alias]='fg=74,standout' ZSH_HIGHLIGHT_STYLES[alias]='fg=74,underline'
ZSH_HIGHLIGHT_STYLES[builtin]='fg=74,bold' ZSH_HIGHLIGHT_STYLES[builtin]='fg=74,bold'
ZSH_HIGHLIGHT_STYLES[path]='fg=120' ZSH_HIGHLIGHT_STYLES[path]='fg=120'
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=215,bold' ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=215,bold'
@ -23,3 +25,9 @@ ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=35'
ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]='bold,bg=75' ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]='bold,bg=75'
ZSH_HIGHLIGHT_PATTERNS+=('${*}' 'fg=215') ZSH_HIGHLIGHT_PATTERNS+=('${*}' 'fg=215')
else
ZSH_HIGHLIGHT_PATTERNS+=('${*}' 'fg=yellow')
fi