From dd46d9d935cbaec88c434c513fde898279a095e2 Mon Sep 17 00:00:00 2001 From: Alyxia Sother Date: Mon, 5 Jun 2023 09:48:10 +0200 Subject: [PATCH] [zsh] Generate kubectl completions --- zsh/plugins.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zsh/plugins.zsh b/zsh/plugins.zsh index ab4c7db..7e27ed5 100755 --- a/zsh/plugins.zsh +++ b/zsh/plugins.zsh @@ -37,6 +37,15 @@ _plugin project 'https://git.sr.ht/~keanucode/scripts/blob/master/project/projec unset bw_comp_path fi; unset bw_bin + if kctl_bin="$(command_locate kubectl)" && [[ -n "$kctl_bin" ]]; then + kctl_comp_path="${ZSH_CACHE_DIR}/site-functions/_kubectl" + if [[ "$kctl_bin" -nt "$kctl_comp_path" || ! -s "$kctl_comp_path" ]]; then + _perf_timer_start "generate kubectl completions" + "$kctl_bin" completion zsh >| "$kctl_comp_path" + _perf_timer_stop "generate kubectl completions" + fi + fi; unset kctl_comp_path + _plugin nim-compl 'https://raw.githubusercontent.com/nim-lang/Nim/devel/tools/nim.zsh-completion' from=url \ after_load='plugin-cfg-path fpath prepend ""'