feat(Bash): support bash

This commit is contained in:
2026-04-03 16:15:31 +08:00
parent e384a4ad0c
commit d6e7b8b81f
13 changed files with 409 additions and 0 deletions

23
bash/integrations/fzf.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/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