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:
parent
367e9381df
commit
5b14c70c92
9
plugins/k9s/README.md
Normal file
9
plugins/k9s/README.md
Normal 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)
|
||||
```
|
||||
11
plugins/k9s/k9s.plugin.zsh
Normal file
11
plugins/k9s/k9s.plugin.zsh
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user