GitXplorerGitXplorer
p

pip-fzf

public
12 stars
0 forks
1 issues

Commits

List of commits on branch master.
Unverified
b18d8a0e9e905d494ff881760b04fc7d3c63de28

Fix uninstall example

ppaw-lu committed 5 years ago
Unverified
8663cfde184c079e7f9be390d702aadcfbc2ccc0

GIF of usage

ppaw-lu committed 5 years ago
Unverified
4ddee3734f44f64419bcdf6f78ae406e7a845c1b

README

ppaw-lu committed 5 years ago
Unverified
4e23e339a9e99f46b244c6f4f3971596f9b06802

Scripts

ppaw-lu committed 5 years ago

README

The README file for this repository.

pip-fzf

Smart fuzzy completion for pip.

Demo of pip-fzf usage

Usage

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

Install

Dependencies

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

Adding fuzzy pip completion

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.