fzf: Use bfs for ALT_C_COMMAND if available
This commit is contained in:
@@ -116,14 +116,21 @@ export FZF_DEFAULT_COMMAND_FALLBACK
|
|||||||
# Ignore gitignore(5)d files, see also $XDG_CONFIG_HOME/git/ignore
|
# Ignore gitignore(5)d files, see also $XDG_CONFIG_HOME/git/ignore
|
||||||
if (( $+commands[fd] )); then
|
if (( $+commands[fd] )); then
|
||||||
FZF_DEFAULT_COMMAND="fd -L --hidden --type f --no-require-git"
|
FZF_DEFAULT_COMMAND="fd -L --hidden --type f --no-require-git"
|
||||||
|
FZF_ALT_C_COMMAND="${FZF_DEFAULT_COMMAND/-type f/-type d}"
|
||||||
elif (( $+commands[rg] )); then
|
elif (( $+commands[rg] )); then
|
||||||
FZF_DEFAULT_COMMAND="rg -L --hidden --files --no-require-git"
|
FZF_DEFAULT_COMMAND="rg -L --hidden --files --no-require-git"
|
||||||
|
FZF_ALT_C_COMMAND="${FZF_DEFAULT_COMMAND_FALLBACK/-type f/-type d}"
|
||||||
else
|
else
|
||||||
# Fallback to hardcoding the most important paths to prune
|
# Fallback to hardcoding the most important paths to prune
|
||||||
FZF_DEFAULT_COMMAND="$FZF_DEFAULT_COMMAND_FALLBACK"
|
FZF_DEFAULT_COMMAND="$FZF_DEFAULT_COMMAND_FALLBACK"
|
||||||
|
FZF_ALT_C_COMMAND="${FZF_DEFAULT_COMMAND_FALLBACK/-type f/-type d}"
|
||||||
fi
|
fi
|
||||||
export FZF_DEFAULT_COMMAND
|
export FZF_DEFAULT_COMMAND
|
||||||
|
|
||||||
|
if (( $+commands[bfs] )); then
|
||||||
|
FZF_ALT_C_COMMAND="${${FZF_DEFAULT_COMMAND_FALLBACK/-type f/-type d}/#find/bfs}"
|
||||||
|
fi
|
||||||
|
|
||||||
typeset -A fzf_opts=(
|
typeset -A fzf_opts=(
|
||||||
# Clear query if not empty, abort otherwise
|
# Clear query if not empty, abort otherwise
|
||||||
esc cancel
|
esc cancel
|
||||||
|
|||||||
@@ -248,7 +248,6 @@ bindkey -M vicmd '^K' fzf-history-widget
|
|||||||
# ^R fzf-history-widget
|
# ^R fzf-history-widget
|
||||||
# TODO: ^R should insert the history line in BUFFER to differ from ctrl-up
|
# TODO: ^R should insert the history line in BUFFER to differ from ctrl-up
|
||||||
FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND} 2>/dev/null"
|
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.
|
# See .zprofile for FZF_ALT_C_COMMAND
|
||||||
FZF_ALT_C_COMMAND="${FZF_DEFAULT_COMMAND_FALLBACK/-type f/-type d}"
|
|
||||||
comp-source "$ZDOTDIR/plugins/fzf/shell/key-bindings.zsh"
|
comp-source "$ZDOTDIR/plugins/fzf/shell/key-bindings.zsh"
|
||||||
|
|||||||
Reference in New Issue
Block a user