1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-13 22:28:25 +08:00

added k9s completions

This commit is contained in:
Shubham Rajvanshi 2024-09-23 17:20:35 -05:00
parent 367e9381df
commit 5b14c70c92
2 changed files with 20 additions and 0 deletions

9
plugins/k9s/README.md Normal file
View File

@ -0,0 +1,9 @@
# k9s plugin
This plugin adds completion support for the [k9s](https://k9scli.io).
To use it, add `k9s` to the plugins array in your zshrc file:
```zsh
plugins=(... k9s)
```

View File

@ -0,0 +1,11 @@
if (( $+commands[k9s] )); then
# If the completion file does not exist, generate it and then source it
# Otherwise, source it and regenerate in the background
if [[ ! -f "$ZSH_CACHE_DIR/completions/_k9s" ]]; then
k9s completion zsh | tee "$ZSH_CACHE_DIR/completions/_k9s" >/dev/null
source "$ZSH_CACHE_DIR/completions/_k9s"
else
source "$ZSH_CACHE_DIR/completions/_k9s"
k9s completion zsh | tee "$ZSH_CACHE_DIR/completions/_k9s" >/dev/null &|
fi
fi