mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +01:00
feat(tenv): Add tenv plugin
Add plugin with completions for tenv: OpenTofu, Terraform, Terragrunt and Atmos version manager, written in Go.
This commit is contained in:
parent
1b29fd3a46
commit
fd403258f9
2 changed files with 24 additions and 0 deletions
9
plugins/tenv/README.md
Normal file
9
plugins/tenv/README.md
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# tenv plugin
|
||||||
|
|
||||||
|
This plugin adds completion for [tenv](https://github.com/tofuutils/tenv), OpenTofu, Terraform, Terragrunt and Atmos version manager, written in Go.
|
||||||
|
|
||||||
|
To use it, add `tenv` to the plugins array in your zshrc file:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
plugins=(... tenv)
|
||||||
|
```
|
||||||
15
plugins/tenv/tenv.plugin.zsh
Normal file
15
plugins/tenv/tenv.plugin.zsh
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Autocompletion for tenv
|
||||||
|
if (( ! $+commands[tenv] )); then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the completion file doesn't exist yet, we need to autoload it and
|
||||||
|
# bind it to `tenv`. Otherwise, compinit will have already done that.
|
||||||
|
if [[ ! -f "$ZSH_CACHE_DIR/completions/_tenv" ]]; then
|
||||||
|
typeset -g -A _comps
|
||||||
|
autoload -Uz _tenv
|
||||||
|
_comps[tenv]=_tenv
|
||||||
|
fi
|
||||||
|
|
||||||
|
tenv completion zsh >| "$ZSH_CACHE_DIR/completions/_tenv" &|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue