zsh: Add $fzf_default_no_rg

Move the fallback for $FZF_DEFAULT_COMMAND into the variable
fzf_default_no_rg that is always set.

This way FZF_ALT_C_COMMAND can reuse it instead of spawning a new shell
and messing with PATH.
This commit is contained in:
2022-09-19 13:01:30 +02:00
parent ed1bfc6ebf
commit 181971c1db
2 changed files with 10 additions and 11 deletions

View File

@@ -140,8 +140,5 @@ bindkey -M vicmd '^K' fzf-history-widget
FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
# Use the fallback default command when ripgrep is not installed but with
# directories instead of files.
FZF_ALT_C_COMMAND="$(
zsh -c 'path= . "$ZDOTDIR/.zprofile"; echo "$FZF_DEFAULT_COMMAND"' \
| sed 's/-type f/-type d/'
)"
FZF_ALT_C_COMMAND="${fzf_default_no_rg/-type f/-type d}"
comp-source "$ZDOTDIR/plugins/fzf/shell/key-bindings.zsh"