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:
parent
9f7367c550
commit
40c2395f43
13
zshrc
13
zshrc
@ -41,6 +41,19 @@ unsetopt flow_control && stty -ixon
|
|||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
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
|
# Enable prompt themes
|
||||||
autoload -Uz promptinit
|
autoload -Uz promptinit
|
||||||
promptinit
|
promptinit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user