From 516d837e198946b0fecc8f8e550f1d16fbff85c0 Mon Sep 17 00:00:00 2001 From: Tony Blyler Date: Tue, 5 Nov 2024 09:07:27 -0500 Subject: [PATCH] Use ripgrep for fzf first and then the silver searcher if it isn't available --- chezmoi/dot_zshenv | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/chezmoi/dot_zshenv b/chezmoi/dot_zshenv index 85982d7..20c194d 100644 --- a/chezmoi/dot_zshenv +++ b/chezmoi/dot_zshenv @@ -96,9 +96,16 @@ if [ -e "${XDG_RUNTIME_DIR}/docker.sock" ]; then export DOCKER_HOST="unix://${XDG_RUNTIME_DIR}/docker.sock" fi -if command -v fzf &> /dev/null && command -v ag &> /dev/null; then - export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l' - export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}" +if command -v fzf &> /dev/null; then + if command -v rg &> /dev/null; then + export FZF_DEFAULT_COMMAND="rg --files --hidden --follow --glob '!.git'" + elif command -v ag &> /dev/null; then + export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l' + fi + + if [ -n "${FZF_DEFAULT_COMMAND}" ]; then + export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}" + fi fi typeset -U path