This commit is contained in:
Jonathan Stacks 2026-05-19 03:46:42 -07:00 committed by GitHub
commit 150ca7ceb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

20
plugins/sprite/README.md Normal file
View file

@ -0,0 +1,20 @@
# sprite plugin
This plugin adds completion for the [Sprites CLI](https://docs.sprites.dev/cli/installation) (`sprite`).
To use it, add `sprite` to the plugins array in your zshrc file:
```zsh
plugins=(... sprite)
```
This plugin does not add any aliases.
## Cache
This plugin caches the completion script and is automatically updated asynchronously when the plugin is
loaded, which is usually when you start up a new terminal emulator.
The cache is stored at:
- `$ZSH_CACHE_DIR/completions/_sprite` completions script

View file

@ -0,0 +1,14 @@
# Autocompletion for sprite
if (( ! $+commands[sprite] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `sprite`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_sprite" ]]; then
typeset -g -A _comps
autoload -Uz _sprite
_comps[sprite]=_sprite
fi
sprite completion zsh >| "$ZSH_CACHE_DIR/completions/_sprite" &|