junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
62.32k stars 2.35k forks source link

Not searching recursively #3752

Closed himat closed 2 months ago

himat commented 2 months ago

Checklist

Output of fzf --version

0.48.1 (brew)

OS

Shell

Problem / Steps to reproduce

I am definitely missing something because I am finding that fzf is not always searching recursively.

In my terminal, I'm at /opt/homebrew and run fzf and search for "squid" and I get these things back

image

But when I then manually cd into /opt/homebrew/etc/ and run fzf again and search for "squid", not I actually find the files I'm looking for

image

Why did fzf not search fully recursively from the directory that was one up? Didn't work from /opt/homebrew But worked from /opt/homebrew/etc The file is located at /opt/homebrew/etc/squid.conf

junegunn commented 2 months ago

Do you have $FZF_DEFAULT_COMMAND or $FZF_DEFAULT_OPTS defined?

himat commented 2 months ago

I have FZF_DEFAULT_COMMAND defined

╰─❯ echo $FZF_DEFAULT_COMMAND
rg --files --hidden

╰─❯ echo $FZF_DEFAULT_OPTS
junegunn commented 2 months ago

Then try rg --files --hidden | grep squid in /opt/homebrew and see if you get the result.

himat commented 2 months ago

I see, that didn't work. So I guess it's a problem with rg then, thanks

himat commented 2 months ago

I did rg --files --no-ignore | grep squid and now it works Turns out homebrew's /opt/homebrew/ dir is a cloned git dir and contains a .gitignore with only certain files/dirs unignored, so seems like that's why rg is ignoring certain dirs.