Add plugin for finch

This commit is contained in:
Simon Marty 2025-09-30 21:02:53 -07:00 committed by GitHub
commit f5c03eae01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

15
plugins/finch/README.md Normal file
View file

@ -0,0 +1,15 @@
# Finch plugin
This plugin adds auto-completion and aliases for [finch](https://runfinch.com/).
To use it add `finch` to the plugins array in your zshrc file.
```zsh
plugins=(... finch)
```
## Aliases
| Alias | Command | Description |
| :------ | :---------- | :----------------------------------------------- |
| fvm | `finch vm` | Operate on the Virtual Machine container runtime |

View file

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