2
0
mirror of https://github.com/junegunn/fzf synced 2024-10-30 09:20:14 +00:00

optimize fzf_default_completion binding

This commit is contained in:
Aleks Kamko 2016-06-11 15:19:16 -07:00
parent 3e1d6a7bcf
commit 19339e3a6d

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