1password.plugin.zsh 424 B

123456789101112131415
  1. # Do nothing if op is not installed
  2. (( ${+commands[op]} )) || return
  3. # If the completion file doesn't exist yet, we need to autoload it and
  4. # bind it to `op`. Otherwise, compinit will have already done that.
  5. if [[ ! -f "$ZSH_CACHE_DIR/completions/_op" ]]; then
  6. typeset -g -A _comps
  7. autoload -Uz _op
  8. _comps[op]=_op
  9. fi
  10. op completion zsh >| "$ZSH_CACHE_DIR/completions/_op" &|
  11. # Load opswd function
  12. autoload -Uz opswd