m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 07:43:39 -05:00

Add completion for pass entries

Arden Zhan
2021-03-19 00:15:29 -05:00
parent 59f3fdf1aa
commit 34901fdabc

@@ -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 ### [BASH] Custom trigger-less completion
If you want to remove the `**` trigger just for certain completions, you can achieve this like so: If you want to remove the `**` trigger just for certain completions, you can achieve this like so:
``` ```bash
_fzf_complete_ssh_notrigger() { _fzf_complete_ssh_notrigger() {
FZF_COMPLETION_TRIGGER='' _fzf_host_completion FZF_COMPLETION_TRIGGER='' _fzf_host_completion
} }