FS#58310 - [python-pipenv] out-of-box zsh completion?

Attached to Project: Community Packages
Opened by lilydjwg (lilydjwg) - Monday, 23 April 2018, 07:01 GMT
Last edited by Eli Schwartz (eschwartz) - Wednesday, 25 April 2018, 13:58 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Morten Linderud (Foxboron)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Can you generate a /usr/share/zsh/site-functions/_pipenv file so that zsh completion works out-of-box? This will also speed up zsh startup very significantly than configured by running "pipenv --completion" every time (it took me over 1.5s every time, with a SSD. It still completes slowly, but will not hurt zsh when the user isn't using it.)

Additional info:
* package version(s)
* config and/or log files etc.

python-pipenv 11.10.0-1
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Wednesday, 25 April 2018, 13:58 GMT
Reason for closing:  Implemented
Additional comments about closing:  python-pipenv 11.10.0-2
Comment by Eli Schwartz (eschwartz) - Monday, 23 April 2018, 12:14 GMT
Well, it's not going to help you much.

The completion file looks like this:

```
#compdef pipenv
_pipenv() {
eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv)
}
if [[ "$(basename ${(%):-%x})" != "_pipenv" ]]; then
autoload -U compinit && compinit
compdef _pipenv pipenv
fi

```

So it's still going to run pipenv every time you try tab-completing...
Comment by lilydjwg (lilydjwg) - Monday, 23 April 2018, 14:25 GMT
Yes I know that. But I don't need to regenerate this piece of code every time when my zsh starts. (Actually I don't. I've saved it in a _pipenv.) It will be useful if you prepare it so people don't need to do this themselves (and worry the saved version may break someday). (And it'll be good to save a version of bash and fish completion files too.)

Loading...