24 lines
960 B
Bash
24 lines
960 B
Bash
#!/usr/bin/env bash
|
|
|
|
if [[ -z "${FZF_DEFAULT_COMMAND:-}" ]]; then
|
|
if command -v fd >/dev/null 2>&1; then
|
|
export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git'
|
|
elif command -v rg >/dev/null 2>&1; then
|
|
export FZF_DEFAULT_COMMAND='rg --files --hidden --glob "!.git/*"'
|
|
elif command -v ag >/dev/null 2>&1; then
|
|
export FZF_DEFAULT_COMMAND='ag -l --hidden -g "" --ignore .git'
|
|
fi
|
|
fi
|
|
|
|
if command -v fzf >/dev/null 2>&1; then
|
|
if [[ -f "$HOME/.fzf.bash" ]]; then
|
|
source "$HOME/.fzf.bash"
|
|
elif [[ -f "/usr/share/fzf/key-bindings.bash" ]]; then
|
|
source "/usr/share/fzf/key-bindings.bash"
|
|
[[ -f "/usr/share/fzf/completion.bash" ]] && source "/usr/share/fzf/completion.bash"
|
|
elif [[ -f "/usr/share/doc/fzf/examples/key-bindings.bash" ]]; then
|
|
source "/usr/share/doc/fzf/examples/key-bindings.bash"
|
|
[[ -f "/usr/share/doc/fzf/examples/completion.bash" ]] && source "/usr/share/doc/fzf/examples/completion.bash"
|
|
fi
|
|
fi
|