zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.73k stars 122 forks source link

feat: check for completion files #618

Open vladdoster opened 5 months ago

vladdoster commented 5 months ago

Description

Related Issue(s)

Motivation and Context

Usage examples

before

zinit for cp"hub-*/etc/hub.zsh_completion -> _hub" from'gh-r' sbin'hub' @mislav/hub

after

zinit for from'gh-r' sbin'hub' @mislav/hub

How Has This Been Tested?

Types of changes

Checklist:

vladdoster commented 5 months ago

Automatically detect completion files

Screenshot 2024-01-09 at 05 38 15
vladdoster commented 5 months ago

@jankatins, thoughts?

jankatins commented 5 months ago

To be honest, I'm fine with the "less magic" variant of renaming to _something instead of automagically figuring out a file which contains completions ("explicit is better than implicit" -> python zen :-)). I tried to figure out which line actually contains the trigger and I think I found it (**/(_*|*.zsh*) or so) and that looks fine...

What happens if two files end up getting symlinked under the same name?