fzf: Add --no-require-git to FZF_DEFAULT_COMMAND

This way fd and rg utilize the gitignore when called from a non-git
parent directory too.
This commit is contained in:
2024-01-05 15:31:04 +01:00
parent 21668c657d
commit 3796e867d2

View File

@@ -110,9 +110,9 @@ export FZF_DEFAULT_COMMAND_FALLBACK
# Ignore gitignore(5)d files, see also $XDG_CONFIG_HOME/git/ignore
if (( $+commands[fd] )); then
FZF_DEFAULT_COMMAND="fd -L --hidden --type f"
FZF_DEFAULT_COMMAND="fd -L --hidden --type f --no-require-git"
elif (( $+commands[rg] )); then
FZF_DEFAULT_COMMAND="rg -L --hidden --files"
FZF_DEFAULT_COMMAND="rg -L --hidden --files --no-require-git"
else
# Fallback to hardcoding the most important paths to prune
FZF_DEFAULT_COMMAND="$FZF_DEFAULT_COMMAND_FALLBACK"