Add default pip completion

The default pip completion is suboptimal because it uses the old Zsh
completion engine which is compatible with bash.
This commit is contained in:
Kenneth Benzie 2018-01-01 18:28:42 +00:00 committed by Kenneth Benzie (Benie)
parent 9f7367c550
commit 40c2395f43

13
zshrc
View File

@ -41,6 +41,19 @@ unsetopt flow_control && stty -ixon
autoload -U compinit
compinit
# Add pip to the old completion engine if present
if which pip &> /dev/null; then
function _pip_completion {
local words cword
read -Ac words
read -cn cword
reply=( $( COMP_WORDS="$words[*]" \
COMP_CWORD=$(( cword-1 )) \
PIP_AUTO_COMPLETE=1 $words[1] ) )
}
compctl -K _pip_completion pip
fi
# Enable prompt themes
autoload -Uz promptinit
promptinit