1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-10-14 15:49:09 +00:00

python: Optimize completion for loading lazily on demand

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.
This commit is contained in:
Indrajit Raychaudhuri
2020-11-30 23:55:27 -06:00
committed by Indrajit Raychaudhuri
parent d686da3c03
commit f0942e6dda
3 changed files with 24 additions and 32 deletions

View File

@@ -2,6 +2,9 @@
Enables local Python and local Python package installation.
This module must be loaded _before_ the _`completion`_ module so that the
provided completion definitions are loaded.
## Settings
This module supports virtual environments from conda and
@@ -143,7 +146,7 @@ Then add `$python_info[virtualenv]` to `$PROMPT` or `$RPROMPT` and call
Similarly, you can use `:prezto:module:python:info:version:format` with `%v` for
the version and add `$python_info[version]` to your prompt for the current
python version/
python version.
## Authors