zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.99k stars 127 forks source link

feat: On demand plugin-id completor and ice name completor. #551

Closed psprint closed 8 months ago

psprint commented 1 year ago

Description

I'm refreshing the pr #406 because I think that it's important extension to Zinit.

The goal is to complete plugin names and ices, because current _zinit completion doesn't support the for syntax.

To complete plugin names, one will be able to obtain, e.g.:

zinit fzf<Alt>-<Shift>-A
    » zinit junegunn/fzf
zinit cd rip<Alt>-<Shift>-A
    » zinit cd BurntSushi/ripgrep

and so on. The --A shortcut works with ALL commands, regardless if it's zinit command or not.

For completion of ices, there's <Alt>-<Shift>-C. Cycling will allow to choose a particular match, say for, e.g.:

zinit at<Alt>-<Shift>-C
    » zinit atclone<Alt><Shift>-C
    » zinit atinit<Alt>-<Shift>-C

Related Issue(s)

Old pr: #406.

Motivation and Context

It always bothers me that the _zinit completion supports only the classic syntax, blocking completion of plugin names. This is a solution to the problem.

Usage examples

zinit fzf<Alt>-<Shift>-A
    » zinit junegunn/fzf
zinit cd rip<Alt>-<Shift>-A
    » zinit cd BurntSushi/ripgrep

zinit at<Alt>-<Shift>-C
    » zinit atclone<Alt><Shift>-C
    » zinit atinit<Alt>-<Shift>-C

How Has This Been Tested?

By interactive use.

Types of changes

Checklist:

psprint commented 1 year ago

@vladdoster @pschmitt @alichtman: ping

psprint commented 1 year ago

@vladdoster: ping