mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 10:01:11 +02:00
25 lines
721 B
Text
25 lines
721 B
Text
#compdef -K _expand_word complete-word \C-xe _list_expansions list-choices \C-xd
|
|
|
|
# Simple completion front-end implementing expansion.
|
|
|
|
setopt localoptions nullglob rcexpandparam extendedglob unset
|
|
unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
|
|
|
|
local curcontext="$curcontext"
|
|
local -ah completers
|
|
|
|
if [[ -z "$curcontext" ]]; then
|
|
curcontext="expand-word:::"
|
|
else
|
|
curcontext="expand-word:${curcontext#*:}"
|
|
fi
|
|
|
|
if zstyle -t ":completion:${curcontext}:" completions; then
|
|
zstyle -a ":completion:${curcontext}:" completer completers
|
|
completers[1,(i)_expand]=_expand
|
|
(( $#completers == 1 )) && completers=(_expand _complete)
|
|
else
|
|
completers=(_expand)
|
|
fi
|
|
|
|
_main_complete $completers
|