1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2025-12-06 07:20:40 +01:00

fzf: setup FZF_DEFAULT_COMMAND based on installed tools (#8895)

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
This commit is contained in:
Alessandro Martini
2020-09-04 17:13:45 -03:00
committed by GitHub
parent 415be382ca
commit 708ea42384
2 changed files with 32 additions and 8 deletions

View File

@@ -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