zinit icon indicating copy to clipboard operation
zinit copied to clipboard

feat: check for completion files

Open vladdoster opened this issue 1 year ago • 3 comments

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

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] Documentation change
  • [ ] New feature (non-breaking change which adds functionality)

Checklist:

  • [ ] All new and existing tests passed.
  • [ ] I have added tests to cover my changes.
  • [ ] I have updated the documentation accordingly.

vladdoster avatar Jan 09 '24 10:01 vladdoster

Automatically detect completion files

Screenshot 2024-01-09 at 05 38 15

vladdoster avatar Jan 09 '24 11:01 vladdoster

@jankatins, thoughts?

vladdoster avatar Jan 09 '24 12:01 vladdoster

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?

jankatins avatar Jan 15 '24 08:01 jankatins