Open a-sk opened 11 years ago
@a-sk / @burke: The snippet above gets me half way there. However, the completions are listed in alphabetical order, as opposed to the order that matcher
writes out to stdout
.
Any idea how to fix the order?
I looked around for other completion funcs that sort, and I wound up with something like this:
_matcher_complete() {
integer i=1
(git ls-files 2>/dev/null || find .) | /usr/local/bin/matcher -l20 ${words[CURRENT]} | while read line; do
compadd -U -2 -V $i -- "$line"
i=$((i+1))
done
compstate[insert]=menu
}
I'm a ZSH noob, so I could quite possible be doing plenty of stupid things in the above code. man zshcompwid
has some notes on the compadd
flags.
Not sure if this is the same behaviour as before, but it kind of works for me:
_matcher() {
(git ls-files 2>/dev/null || locate .) | /Users/flo/.vim/matcher/matcher -l20 ${words[CURRENT]} | while read line; do
compadd -U "$line"
done
compstate[insert]=menu # no expand
}
zle -C matcher complete-word _generic
zstyle ':completion:matcher:*' completer _matcher
zstyle ':completion:matcher:*' menu-select
# C-t to find matches for the search under the cursor
bindkey '^T' matcher
(ping @burke)
Please look at the similar issue - https://github.com/clvv/fasd/issues/6
I got the same error
invalid widget 'menu-select'
Please, consider changing zsh widget example to something like: