diff options
author | Alessandro Martini <alessandrofmartini@gmail.com> | 2020-09-04 17:13:45 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 22:13:45 +0200 |
commit | 708ea42384d378343a590fc34a3dee536a1651df (patch) | |
tree | 436a76153365461e9f4817084149c6e6f78c61da /plugins/fzf/fzf.plugin.zsh | |
parent | 415be382caed0bc4d31732aea145f0fd880b8c1d (diff) | |
download | zsh-708ea42384d378343a590fc34a3dee536a1651df.tar.gz zsh-708ea42384d378343a590fc34a3dee536a1651df.tar.bz2 zsh-708ea42384d378343a590fc34a3dee536a1651df.zip |
fzf: setup FZF_DEFAULT_COMMAND based on installed tools (#8895)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
Diffstat (limited to 'plugins/fzf/fzf.plugin.zsh')
-rw-r--r-- | plugins/fzf/fzf.plugin.zsh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 53bdcbc97..0b831b7f7 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -98,3 +98,13 @@ function indicate_error() { setup_using_debian_package || setup_using_base_dir || indicate_error unset -f setup_using_debian_package setup_using_base_dir indicate_error + +if [[ -z "$FZF_DEFAULT_COMMAND" ]]; then + if (( $+commands[rg] )); then + export FZF_DEFAULT_COMMAND='rg --files --hidden' + elif (( $+commands[fd] )); then + export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git' + elif (( $+commands[ag] )); then + export FZF_DEFAULT_COMMAND='ag -l --hidden -g ""' + fi +fi |