From 708ea42384d378343a590fc34a3dee536a1651df Mon Sep 17 00:00:00 2001 From: Alessandro Martini Date: Fri, 4 Sep 2020 17:13:45 -0300 Subject: fzf: setup FZF_DEFAULT_COMMAND based on installed tools (#8895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/fzf/fzf.plugin.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugins/fzf/fzf.plugin.zsh') 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 -- cgit v1.2.3-70-g09d2