-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
|
||
# pip zsh completion start | ||
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] 2>/dev/null )) | ||
#compdef -P pip[0-9.]# | ||
__pip() { | ||
compadd $( COMP_WORDS="$words[*]" \ | ||
COMP_CWORD=$((CURRENT-1)) \ | ||
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null ) | ||
} | ||
compctl -K _pip_completion /opt/homebrew/opt/python@3.9/bin/python3.9 -m pip | ||
if [[ $zsh_eval_context[-1] == loadautofunc ]]; then | ||
# autoload from fpath, call function directly | ||
__pip "$@" | ||
else | ||
# eval/source/. command, register function for later | ||
compdef __pip -P 'pip[0-9.]#' | ||
fi | ||
# pip zsh completion end | ||
|