mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-02 17:01:19 +02:00
36 lines
624 B
Plaintext
36 lines
624 B
Plaintext
#compdef -k complete-word \C-xh
|
|
|
|
_complete_help() {
|
|
local _sort_tags=_help_sort_tags text i
|
|
typeset -A help_tags
|
|
typeset -U help_contexts
|
|
|
|
help_contexts=()
|
|
|
|
compadd() { return 1 }
|
|
|
|
_main_complete
|
|
|
|
unfunction compadd
|
|
|
|
for i in "$help_contexts[@]"; do
|
|
text="${text}
|
|
tags in context \`${i}': ${help_tags[$i]}"
|
|
done
|
|
|
|
compstate[list]=list
|
|
compstate[force_list]=yes
|
|
compstate[insert]=''
|
|
|
|
compadd -UX "$text[2,-1]" -n ''
|
|
}
|
|
|
|
_help_sort_tags() {
|
|
help_contexts=( "$help_contexts[@]" "$curcontext" )
|
|
help_tags[$curcontext]="${help_tags[$curcontext]}
|
|
${argv}"
|
|
comptry "$@"
|
|
}
|
|
|
|
_complete_help "$@"
|