我有一个 ZSH 完成器,它提供预期的完成,但按字典顺序提供它们,而不是通过添加它们的顺序compadd
:
_matcher_complete() {
(git ls-files 2>/dev/null || find .) | /usr/local/bin/matcher -l20 ${words[CURRENT]} | while read line; do
compadd -U "$line"
done
compstate[insert]=menu
}
zle -C matcher-complete complete-word _generic
zstyle ':completion:matcher-complete:*' completer _matcher_complete
zstyle ':completion:matcher-complete:*' menu-select
bindkey '^X^T' matcher-complete
如何按插入顺序订购完成?