From fe1a5290fe14d7afb67da594047d84c55603003f Mon Sep 17 00:00:00 2001 From: "Alexander Gehrke (crater2150)" Date: Tue, 5 Jan 2016 03:51:22 +0100 Subject: [PATCH] module "highlight": check available colors --- modules/highlight/init | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/highlight/init b/modules/highlight/init index be4f231..c4ffec2 100644 --- a/modules/highlight/init +++ b/modules/highlight/init @@ -1,12 +1,14 @@ . $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[single-hyphen-option]='fg=74' ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='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[path]='fg=120' 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_PATTERNS+=('${*}' 'fg=215') + +else + +ZSH_HIGHLIGHT_PATTERNS+=('${*}' 'fg=yellow') + +fi