From 68795c217069164e8dd31ae451512d7060bfc45c Mon Sep 17 00:00:00 2001 From: nervo Date: Mon, 28 Sep 2026 10:24:35 +0200 Subject: [PATCH] feat(sops): introduce plugin (#14120) --- plugins/sops/README.md | 3 +++ plugins/sops/sops.plugin.zsh | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 plugins/sops/README.md create mode 100644 plugins/sops/sops.plugin.zsh diff --git a/plugins/sops/README.md b/plugins/sops/README.md new file mode 100644 index 000000000..4d611e533 --- /dev/null +++ b/plugins/sops/README.md @@ -0,0 +1,3 @@ +## Sops Plugin + +This plugin sets up completion for [sops](https://getsops.io). diff --git a/plugins/sops/sops.plugin.zsh b/plugins/sops/sops.plugin.zsh new file mode 100644 index 000000000..695105808 --- /dev/null +++ b/plugins/sops/sops.plugin.zsh @@ -0,0 +1,18 @@ +# COMPLETION FUNCTION +if (( ! $+commands[sops] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `sops`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_sops" ]]; then + typeset -g -A _comps + autoload -Uz _sops + _comps[sops]=_sops +fi + +zmodload -F zsh/files b:zf_mv +() { + local TMPPREFIX="$ZSH_CACHE_DIR/completions/._sops" + zf_mv -f -- =( sops completions zsh ) "$ZSH_CACHE_DIR/completions/_sops" +} &|