diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 2ef6065..e0ead35 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -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" diff --git a/.config/zsh/zshrc.d/60-keys.zsh b/.config/zsh/zshrc.d/60-keys.zsh index 2a956a3..0fff666 100644 --- a/.config/zsh/zshrc.d/60-keys.zsh +++ b/.config/zsh/zshrc.d/60-keys.zsh @@ -138,9 +138,10 @@ bindkey -M vicmd '^K' fzf-history-widget # \ec (Alt-C) fzf-cd-widget # ^R fzf-history-widget FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}" -FZF_ALT_C_COMMAND="find -L . -mindepth 1 \(" - FZF_ALT_C_COMMAND+=" -name '.git' -o" - FZF_ALT_C_COMMAND+=" -name '__pycache__' -o" - FZF_ALT_C_COMMAND+=" -name 'node_modules'" -FZF_ALT_C_COMMAND+=" \) -prune -o -type d -print" +# 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/' +)" comp-source "$ZDOTDIR/plugins/fzf/shell/key-bindings.zsh"