helm.plugin.zsh 748 B

12345678910111213141516171819202122
  1. if (( ! $+commands[helm] )); then
  2. return
  3. fi
  4. # TODO: 2021-12-28: delete this block
  5. # Remove old generated file
  6. command rm -f "${ZSH_CACHE_DIR}/helm_completion"
  7. # TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh
  8. # Add completions folder in $ZSH_CACHE_DIR
  9. command mkdir -p "$ZSH_CACHE_DIR/completions"
  10. (( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
  11. # If the completion file doesn't exist yet, we need to autoload it and
  12. # bind it to `helm`. Otherwise, compinit will have already done that.
  13. if [[ ! -f "$ZSH_CACHE_DIR/completions/_helm" ]]; then
  14. typeset -g -A _comps
  15. autoload -Uz _helm
  16. _comps[helm]=_helm
  17. fi
  18. helm completion zsh >| "$ZSH_CACHE_DIR/completions/_helm" &|