ElectricRCAircraftGuy / ripgrep_replace

ripgrep_replace, or rgr, is a light-weight wrapper around ripgrep, supporting 100% of ripgrep's features + adding '-R' to enable on-disk find-and-replace; rgf2 is an interactive regex finder and viewer with syntax highlighting
MIT License
21 stars 4 forks source link

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

Open ElectricRCAircraftGuy opened 2 years ago

ElectricRCAircraftGuy commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

rg -n --hidden --color always hey | fzf --ansi
ElectricRCAircraftGuy commented 2 years ago

Use more sublf too.

ElectricRCAircraftGuy commented 2 years ago

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 commented 2 years ago

maybe --no-clear?