From 34901fdabce220e55e29b007752b0e4faca52443 Mon Sep 17 00:00:00 2001 From: Arden Zhan Date: Fri, 19 Mar 2021 00:15:29 -0500 Subject: [PATCH] Add completion for pass entries --- Examples-(completion).md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Examples-(completion).md b/Examples-(completion).md index 846a5c7..b2312ce 100644 --- a/Examples-(completion).md +++ b/Examples-(completion).md @@ -50,11 +50,24 @@ _fzf_complete_git_post() { } ``` +### [ZSH] [pass](http://www.passwordstore.org/) +```zsh +_fzf_complete_pass() { + _fzf_complete +m -- "$@" < <( + local prefix + prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + command find -L "$prefix" \ + -name "*.gpg" -type f | \ + sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#' | sort + ) +} +``` + ### [BASH] Custom trigger-less completion If you want to remove the `**` trigger just for certain completions, you can achieve this like so: -``` +```bash _fzf_complete_ssh_notrigger() { FZF_COMPLETION_TRIGGER='' _fzf_host_completion }