mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-10 06:14:12 +00:00
*highlight,*plugin.zsh: Highlight variables when 256 color terminal
This commit is contained in:
parent
2bf4e674ba
commit
64f47cec06
2 changed files with 9 additions and 1 deletions
|
@ -15,5 +15,9 @@ zle -N history-search-multi-word
|
|||
zle -N history-search-multi-word-backwards history-search-multi-word
|
||||
zle -N history-search-multi-word-pbackwards history-search-multi-word
|
||||
zle -N history-search-multi-word-pforwards history-search-multi-word
|
||||
[[ "${+termcap[Co]}" = 1 && "${termcap[Co]}" = "256" ]] && zstyle ":history-search-multi-word" highlight-color "bg=17"
|
||||
[[ "${+termcap[Co]}" = 1 && "${termcap[Co]}" = "256" ]] && {
|
||||
zstyle ":history-search-multi-word" highlight-color "bg=17"
|
||||
typeset -gA HSMW_HIGHLIGHT_STYLES
|
||||
HSMW_HIGHLIGHT_STYLES[variable]="fg=112"
|
||||
}
|
||||
bindkey "^R" history-search-multi-word
|
||||
|
|
|
@ -59,6 +59,7 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
|
|||
: ${HSMW_HIGHLIGHT_STYLES[redirection]:=none}
|
||||
: ${HSMW_HIGHLIGHT_STYLES[comment]:=fg=black,bold}
|
||||
: ${HSMW_HIGHLIGHT_STYLES[newline]:=fg=black,bold} # '\n' strings
|
||||
: ${HSMW_HIGHLIGHT_STYLES[variable]:=none}
|
||||
|
||||
|
||||
typeset -gA __HSMW_HIGHLIGHT_TOKENS_TYPES
|
||||
|
@ -527,6 +528,9 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
|
|||
-hsmw-highlight-dollar-string
|
||||
already_added=1
|
||||
;;
|
||||
\$[^\(]*)
|
||||
style=variable
|
||||
;;
|
||||
'`'*) style=back-quoted-argument;;
|
||||
[*?]*|*[^\\][*?]*)
|
||||
(( highlight_glob )) && style=globbing || style=default;;
|
||||
|
|
Loading…
Reference in a new issue