Last active
February 26, 2025 00:26
-
-
Save GeneralD/a7fe68ab28195799cc01c558b93bd384 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type op &>/dev/null && { | |
eval "$(op completion zsh)" && compdef _op op | |
[ -f ~/.config/op/plugins.sh ] && source ~/.config/op/plugins.sh | |
# enable auto-completion through op plugins | |
local plugins=($(\ls -1 ~/.config/op/plugins/used_items | sed 's/.[^.]*$//')) | |
for plugin in $plugins; do | |
eval " | |
function _${plugin}_wrapped() { | |
op plugin run -- $plugin \$@ | |
} | |
alias $plugin=_${plugin}_wrapped | |
compdef _$plugin _${plugin}_wrapped | |
" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment