zsh:keys: Reuse the default fallback for FZF_ALT_C

Instead of implementing it twice, simulate a shell without ripgrep to
get the fallback of FZF_DEFAULT_COMMAND and modify it for use with
directories.
This commit is contained in:
2022-09-19 12:52:00 +02:00
parent 85b95dce37
commit 1dab31ecda
2 changed files with 7 additions and 5 deletions

View File

@@ -95,6 +95,7 @@ if (( $+commands[rg] )); then
FZF_DEFAULT_COMMAND="rg -L --hidden --files -g '!.git'"
else
# Fallback to hardcoding the most important paths to prune
# NOTE: This version is used in keys.zsh for the ALT_C widget
FZF_DEFAULT_COMMAND="find -L . \("
FZF_DEFAULT_COMMAND+=" -name '.git' -o"
FZF_DEFAULT_COMMAND+=" -name '__pycache__' -o"