Merge pull request #595 from aykamko/speed-up-fzf-completion

Optimize fzf_default_completion binding
This commit is contained in:
Junegunn Choi 2016-06-12 11:56:49 +09:00 committed by GitHub
commit 07f176f426

View File

@ -181,8 +181,11 @@ fzf-completion() {
fi
}
[ -z "$fzf_default_completion" ] &&
fzf_default_completion=$(bindkey '^I' | \grep -v undefined-key | awk '{print $2}')
[ -z "$fzf_default_completion" ] && {
binding=$(bindkey '^I')
[[ $binding =~ 'undefined-key' ]] || fzf_default_completion=$binding[(w)2]
unset binding
}
zle -N fzf-completion
bindkey '^I' fzf-completion