Skip to content

Commit 2355da8

Browse files
Make fzf file picks Git-aware
Ripgrep walks the filesystem and can surface ignored or generated repo files. Prefer Git tracked and unignored files in repositories so fzf starts from the project file set, while keeping ripgrep as the fallback outside Git worktrees.
1 parent cdf0c7c commit 2355da8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.zshenv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ alias pd="afplay /System/Library/Sounds/Glass.aiff && terminal-notifier -title '
5757

5858
alias rsync=$'rsync --cvs-exclude --filter=\':- ~/.gitignore\''
5959

60-
export FZF_DEFAULT_COMMAND='rg --files --follow --glob "!.git/*"'
60+
export FZF_DEFAULT_COMMAND='git ls-files --cached --others --exclude-standard 2>/dev/null || rg --files --follow --glob "!.git/*"'
6161
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
6262
export RIPGREP_CONFIG_PATH="$HOME/.rgrc"
6363

0 commit comments

Comments
 (0)