mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
Merge b6aeb73109 into cb64103161
This commit is contained in:
commit
150ca7ceb9
2 changed files with 34 additions and 0 deletions
20
plugins/sprite/README.md
Normal file
20
plugins/sprite/README.md
Normal 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
|
||||||
14
plugins/sprite/sprite.plugin.zsh
Normal file
14
plugins/sprite/sprite.plugin.zsh
Normal 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" &|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue