diff --git a/completion/_autocomplete.all_matches b/completion/_autocomplete.all_matches index b2ae6954..476ab655 100644 --- a/completion/_autocomplete.all_matches +++ b/completion/_autocomplete.all_matches @@ -18,6 +18,6 @@ else return fi -local -a expl disp=( '' ) +local -a expl _description all-matches expl 'all matches' -compadd "$expl[@]" -d disp -C +compadd "$expl[@]" -C diff --git a/completion/_autocomplete.unambiguous b/completion/_autocomplete.unambiguous index 85c85b3c..905ff3ab 100644 --- a/completion/_autocomplete.unambiguous +++ b/completion/_autocomplete.unambiguous @@ -23,5 +23,6 @@ fi local tag=unambiguous _tags $tag _tags && _requested $tag && - _message -e unambiguous "common substring:%b %F{0}%K{11}$compstate[unambiguous]%f%k" - # Black text on bright yellow background + _message -e unambiguous \ + $'%B%{\e[2m%}Shift-Tab:%b %{\e[2m%}insert %b%F{0}%K{11}'"$compstate[unambiguous]%f%k" + # \e[2m = faint; 0 = black; 11 = bright yellow diff --git a/module/.autocomplete.config b/module/.autocomplete.config index 3c3f37f3..c99b671b 100644 --- a/module/.autocomplete.config +++ b/module/.autocomplete.config @@ -62,6 +62,7 @@ zstyle ':completion:*:options' matcher 'b:-=+' zstyle ':completion:*' prefix-needed yes zstyle ':completion:*:expand:*' accept-exact continue +zstyle ':completion:*:expand-alias:*' complete yes zstyle ':completion:*' ignore-parents 'parent pwd directory' zstyle ':completion:*:users' ignored-patterns '_*' zstyle ':completion:*:widgets' ignored-patterns '.*' '*:*' '*orig-*' @@ -94,15 +95,11 @@ _autocomplete.config.warnings-format() { reply=( $'%{\e[01;02;39m%}'"No ${${:-$PREFIX$SUFFIX}:+matching }$d found."$'%{\e[0m%}' ) } -local kbd=$'%{\e[22;39m%}' -zstyle ':completion:*:unambiguous' format \ - "$h1%d$hint (press ${kbd}Shift${hint}-${kbd}Tab$hint to insert)$end" -zstyle -e ':completion:*:all-matches' format _autocomplete.config.all-matches-format -_autocomplete.config.all-matches-format() { - local end=$'%{\e[0m%}' hint=$'%{\e[22;02;39m%}' kbd=$'%{\e[22;39m%}' - reply=( $'%{\e[01;02;39m%}'"%d$end" ) - [[ $IPREFIX$PREFIX$SUFFIX$ISUFFIX == *${compstate[unambiguous]:#?}* ]] && - reply[1]+=" ${hint}(press ${kbd}Shift${hint}-${kbd}Tab$hint to insert)$end" +zstyle ':completion:*:all-matches' format $'%B%{\e[2m%}Shift-Tab:%b %{\e[2m%}insert %d%b' +zstyle -e ':completion:*:all-matches' hidden _autocomplete.config.all-matches-hidden +_autocomplete.config.all-matches-hidden() { + reply=( all ); [[ $IPREFIX$PREFIX$SUFFIX$ISUFFIX == *${compstate[unambiguous]:#?}* ]] && + reply=( yes ) } zstyle ':completion:*:history-lines' format ''