mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 21:58:00 +00:00
f0942e6dda
Move `pip` to separate completion definition delegating to pip to do all the completion work. Since the completion is loaded lazily on-demand, it avoids the performance overhead during Zsh initialization. Implementation note: The helper function `_pip_completion` implementation is based on the official pip completion function (which can be generated with `pip completion --zsh`) adhering to the newer compsys style. See: 'man zshcompsys' for more details.
20 lines
397 B
Plaintext
20 lines
397 B
Plaintext
#compdef -P pip[0-9.]#
|
|
#autoload
|
|
|
|
#
|
|
# Pip completion, delegating to pip to do all the completion work.
|
|
#
|
|
# Authors:
|
|
# Indrajit Raychaudhuri <irc@indrajit.com>
|
|
#
|
|
|
|
if (( $+commands[$words[1]] )); then
|
|
|
|
function _pip_completion {
|
|
compadd -- $( COMP_WORDS="$words[*]" COMP_CWORD=$(( CURRENT - 1 )) \
|
|
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )
|
|
}
|
|
_pip_completion "$@"
|
|
|
|
fi
|