zprofile: Fix non-export of FZF_DEFAULT_NO_RG

I never really noticed but `$FZF_ALT_C_COMMAND` was never set as
`$fzf_default_no_rg` would be empty. Because the variable was not
exported, the X session would not have it in it's environment.
This commit is contained in:
2023-06-23 13:35:41 +02:00
parent 5d0616c34f
commit 2114987106
2 changed files with 9 additions and 8 deletions

View File

@@ -96,19 +96,20 @@ export LESS
export MANPAGER='nvim +"Man! | set scrolloff=999 | normal M"'
# NOTE: This is used in keys.zsh for the ALT_C widget
fzf_default_no_rg="find -L . -mindepth 1 \("
fzf_default_no_rg+=" -name '.git' -o"
fzf_default_no_rg+=" -name '__pycache__' -o"
fzf_default_no_rg+=" -name 'node_modules'"
fzf_default_no_rg+=" \) -prune -o -type f -print"
fzf_default_no_rg+=" | cut -c3-"
FZF_DEFAULT_COMMAND_NO_RG="find -L . -mindepth 1 \("
FZF_DEFAULT_COMMAND_NO_RG+=" -name '.git' -o"
FZF_DEFAULT_COMMAND_NO_RG+=" -name '__pycache__' -o"
FZF_DEFAULT_COMMAND_NO_RG+=" -name 'node_modules'"
FZF_DEFAULT_COMMAND_NO_RG+=" \) -prune -o -type f -print"
FZF_DEFAULT_COMMAND_NO_RG+=" | cut -c3-"
export FZF_DEFAULT_COMMAND_NO_RG
if (( $+commands[rg] )); then
# Prune `.git/` and everything ignored by gitignore(5)
FZF_DEFAULT_COMMAND="rg -L --hidden --files -g '!.git'"
else
# Fallback to hardcoding the most important paths to prune
FZF_DEFAULT_COMMAND="$fzf_default_no_rg"
FZF_DEFAULT_COMMAND="$FZF_DEFAULT_COMMAND_NO_RG"
fi
export FZF_DEFAULT_COMMAND

View File

@@ -232,5 +232,5 @@ bindkey -M vicmd '^K' fzf-history-widget
FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND} 2>/dev/null"
# Use the fallback default command when ripgrep is not installed but with
# directories instead of files.
FZF_ALT_C_COMMAND="${fzf_default_no_rg/-type f/-type d}"
FZF_ALT_C_COMMAND="${FZF_DEFAULT_COMMAND_NO_RG/-type f/-type d}"
comp-source "$ZDOTDIR/plugins/fzf/shell/key-bindings.zsh"