Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -f option to rgf to allow it to search the filename too #3

Open
ElectricRCAircraftGuy opened this issue Sep 19, 2022 · 5 comments

Comments

@ElectricRCAircraftGuy
Copy link
Owner

ElectricRCAircraftGuy commented Sep 19, 2022

The internal cmd to do this will be something like this:

rg -n some_search_str | fzf

# try adding color too (doesn't work yet)
rg --color always hey | fzf

Take a look at rgf directly and see if there's an easy way to get it to include the filenames in the search by fzf!

@ElectricRCAircraftGuy ElectricRCAircraftGuy changed the title Add -f option to rgf to allow it to search the filename too Add -f option to rgf to allow it to search the filename too Sep 19, 2022
@ElectricRCAircraftGuy
Copy link
Owner Author

ElectricRCAircraftGuy commented Sep 19, 2022

Update: it looks like simply deleting --disabled from the rgf cmd fixes it! See: https://github.com/junegunn/fzf#3-interactive-ripgrep-integration

Also, note that we used --disabled option so that fzf doesn't perform any secondary filtering.

I looked at man fzf and saw:

--disabled
Do not perform search. With this option, fzf becomes a simple selector interface rather than a "fuzzy finder". You can later enable the search using enable-search or toggle-search
action.

So, removing --disabled appears to allow fzf to search the filenames found by rgf as well!

@ElectricRCAircraftGuy
Copy link
Owner Author

no...try this (searching for word "hey"):

rg -n --hidden --color always hey | fzf --ansi

@ElectricRCAircraftGuy
Copy link
Owner Author

Use more sublf too.

@ElectricRCAircraftGuy
Copy link
Owner Author

Figure out how to make fzf keep the whole screen of last content in the terminal after existing....like less -RFX or whatever, does.

@ElectricRCAircraftGuy
Copy link
Owner Author

maybe --no-clear?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant