Added Python plugin, moved pip completion into it.
This commit is contained in:
parent
ba9900a488
commit
638cfb79bd
@ -1,9 +1,9 @@
|
|||||||
#compdef pip
|
#compdef pip
|
||||||
#autoload
|
#autoload
|
||||||
|
|
||||||
# pip zsh completion, based on homebrew completion
|
# This completion is based on the Homebrew completion.
|
||||||
|
|
||||||
_pip_installed() {
|
function _pip-installed() {
|
||||||
installed_pkgs=(`pip freeze`)
|
installed_pkgs=(`pip freeze`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,10 +37,11 @@ fi
|
|||||||
case "$words[1]" in
|
case "$words[1]" in
|
||||||
list)
|
list)
|
||||||
if [[ "$state" == forms ]]; then
|
if [[ "$state" == forms ]]; then
|
||||||
_pip_installed
|
_pip-installed
|
||||||
_requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
|
_requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
|
||||||
fi ;;
|
fi ;;
|
||||||
uninstall)
|
uninstall)
|
||||||
_pip_installed
|
_pip-installed
|
||||||
_wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
|
_wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
|
||||||
esac
|
esac
|
||||||
|
|
11
plugins/python/python.plugin.zsh
Normal file
11
plugins/python/python.plugin.zsh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Prepend PEP 370 per user site packages directory, which defaults to
|
||||||
|
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH/MANPATH.
|
||||||
|
if [[ "$OSTYPE" == darwin* ]]; then
|
||||||
|
path=($HOME/Library/Python/*/bin(N) $path)
|
||||||
|
manpath=($HOME/Library/Python/*/{,share/}man(N) $manpath)
|
||||||
|
else
|
||||||
|
# This is subject to change.
|
||||||
|
path=($HOME/.local/bin $path)
|
||||||
|
manpath=($HOME/.local/{,share/}man(N) $manpath)
|
||||||
|
fi
|
||||||
|
|
Reference in New Issue
Block a user