mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +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:
parent
415be382ca
commit
708ea42384
2 changed files with 32 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue