commit bf693bf5fbf588ab719bfc5051e9a1284ab948e4 parent 5cee8f15fdfca2a4ac0bb7e6fdafc73a5c1d9c4c Author: Anders Damsgaard <andersd@riseup.net> Date: Mon, 18 Dec 2017 12:43:01 -0500 Add conditional to fzf autocomplete Diffstat:
M | links/.zshrc | | | 22 | ++++++++++++---------- |
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/links/.zshrc b/links/.zshrc @@ -213,16 +213,18 @@ alias egrep='egrep --color=auto' #### AUTOCOMPLETE -# pass **<tab> -_fzf_complete_pass() { - _fzf_complete '+m' "$@" < <( - pwdir=${PASSWORD_STORE_DIR-~/.password-store/} - stringsize="${#pwdir}" - find "$pwdir" -name "*.gpg" -print | - cut -c "$((stringsize + 1))"- | - sed -e 's/\(.*\)\.gpg/\1/' - ) -} +if _has fzf; then + # pass **<tab> + _fzf_complete_pass() { + _fzf_complete '+m' "$@" < <( + pwdir=${PASSWORD_STORE_DIR-~/.password-store/} + stringsize="${#pwdir}" + find "$pwdir" -name "*.gpg" -print | + cut -c "$((stringsize + 1))"- | + sed -e 's/\(.*\)\.gpg/\1/' + ) + } +fi #### PATH AND MACHINE SPECIFIC CONFIGS