Smart fuzzy completion for pip.
Simply type in pip install
or pip uninstall
followed by **
,
and press tab.
Start typing in the name of the packages
to search through the available results.
Press tab to mark each result.
Press return to select all marked results.
The install
completion will allow you to search through
all packages on PyPI.
❯ pip install ** [TAB]
> flake8
240273/240273
> flake8
flake8-nb
flake8-aaa
flake8-csv
flake8mock
flake8-pie
flake8-pyi
flake8-rst
The uninstall
command allows you to search through all installed packages.
❯ pip uninstall ** [TAB]
>
9/9
> black
flake8
flask
invoke
nox
pandas
pip
pytest
setuptools
Fuzzy completion will not run without the following tools installed:
Install all three tools using any of the documented methods on the respective sites.
You must install the fuzzy completion for fzf.
For example, if you installed fzf via Homebrew, this can be accomplished by running
# If fzf was installed via Homebrew
❯ $(brew --prefix)/opt/fzf/install
Installing the above packages is the hardest part.
Run
❯ git clone https://github.com/paw-lu/pip-fzf.git ~/.pip-fzf
Now add
source "$HOME/.pip-fzf/pip_fzf.sh"
to the end of your .zshrc
/.bashrc
/.bash_profile
/etc.
You should now have fuzzy completion for pip after you restart your shell.
Of course,
you can also just copy the functions in pip_fzf.sh
,
and place them directly in your .zshrc
,
or autoload them from another directory.