From 2114987106e3804bfe3ec9076700b9dfce92bc5f Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 23 Jun 2023 13:35:41 +0200 Subject: [PATCH] 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. --- .config/zsh/.zprofile | 15 ++++++++------- .config/zsh/zshrc.d/60-keys.zsh | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index d8187a3..1dedde6 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -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 diff --git a/.config/zsh/zshrc.d/60-keys.zsh b/.config/zsh/zshrc.d/60-keys.zsh index 3f8e4f2..0b8f0b2 100644 --- a/.config/zsh/zshrc.d/60-keys.zsh +++ b/.config/zsh/zshrc.d/60-keys.zsh @@ -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"