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