From 35c5bb5b7985d02c1cf4a1e997f8c83d62cb82af Mon Sep 17 00:00:00 2001 From: Gardouille Date: Sat, 4 Feb 2023 10:44:32 +0100 Subject: [PATCH] Function to edit passwords with fzf+pass --- zshrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zshrc b/zshrc index ba9ac67..37c6870 100644 --- a/zshrc +++ b/zshrc @@ -2468,6 +2468,18 @@ dexec() { } # }}} +# passf − Edit pass's passwords {{{ +# Display existing files in ~/.password-store without .gpg extension +# https://www.passwordstore.org/ +passf() { + local pass_files + + pass_file=$(find ~/.password-store -type f -iname "*.gpg" -printf "%P\n" | sed 's/\(.*\)\.gpg$/\1/' | fzf --prompt='pass > ' ) + + pass edit "${pass_file:-/dev/null}" +} +# }}} + # }}} # zsh-syntax-highlighting {{{ ## Activate if plugin is available