Yggdroot / LeaderF

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.
Apache License 2.0
2.15k stars 179 forks source link

[Feature request] Support quickfix/location lists options to show `rg` search results #447

Closed pirj closed 4 years ago

pirj commented 4 years ago

The results of rg output are shown in a decidated window which is different from the default :grep/:lgrep behaviour. The convenience of the latter two is that :cnext/:cprevious/:cfirst/:clast/... are available, and that makes --recall the default, and --next/--previous redundant as default Vim's commands already exist.

Would it be possible to add --quickfix/--location as an option to rg's window position option?

PS Thanks for LeaderF, it's by far more usable than other fuzzy finders.

Yggdroot commented 4 years ago

I can't see any advantage over the native implementation of LeaderF.

joerideg commented 4 years ago

One advantage is that after running rg and outputting results in the quicklist I can then do cfdo to replace values in those files. Or is there a way to replace values currently that I am not aware of?

joerideg commented 4 years ago

btw I would much rather have a replace function with LeaderF's native implementation then to load them in the quickfix list

tamago324 commented 4 years ago

Hi. It is not an option like --quickfix or--location, but implements output by mapping in the result window.

https://github.com/tamago324/LeaderF/commit/def838ad6c4f7de922c7e6a411864a4a034a78ff

You can output the result of filtering. Q (quickfix list) and L (location list) can be output in normal mode.

What do you think? Would you let us know what you think.

joerideg commented 4 years ago

This sounds usefull!

tamago324 commented 4 years ago

Thanks! Is this what you were looking for?

joerideg commented 4 years ago

If I understand correctly this would allow me to: Put all filtered results directly in the Quick or Location results (And possibly select specific results and put them in) , which is what I needed for search and replace. Now I could do: Leaderf rg, filter stuff, hit Q and then 'cfdo %s/something/somethingelse/`

It would be even more seamless if Leaderf would output the current filter of results into a register so I could prepopulate the replace regex with that.

tamago324 commented 4 years ago

If I understand correctly this would allow me to: Put all filtered results directly in the Quick or Location results (And possibly select specific results and put them in) , which is what I needed for search and replace. Now I could do: Leaderf rg, filter stuff, hit Q and then 'cfdo %s/something/somethingelse/`

Yes. That understanding is correct!

It would be even more seamless if Leaderf would output the current filter of results into a register so I could prepopulate the replace regex with that.

It looks good to save in a register. However, it seems difficult because you can enter multiple search patterns like Leaderf rg -e "hello" -e "world".

If multiple search patterns are specified, you may be able to combine them with |

joerideg commented 4 years ago

Hmmm good point. Alright then, thanks for the effort! Hope it will be in soon.

On Thu, 23 Jan 2020 at 10:52, tamago324 notifications@github.com wrote:

If I understand correctly this would allow me to: Put all filtered results directly in the Quick or Location results (And possibly select specific results and put them in) , which is what I needed for search and replace. Now I could do: Leaderf rg, filter stuff, hit Q and then 'cfdo %s/something/somethingelse/`

Yes. That understanding is correct!

It would be even more seamless if Leaderf would output the current filter of results into a register so I could prepopulate the replace regex with that.

It looks good to save in a register. However, it seems difficult because you can enter multiple search patterns like Leaderf rg -e "hello" -e "world".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Yggdroot/LeaderF/issues/447?email_source=notifications&email_token=ACT5CT3U5GVUHUCUTUXM5HLQ7FSGLA5CNFSM4J6LCD22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJWZLRI#issuecomment-577607109, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACT5CT66WMCFWPRABSZFLE3Q7FSGLANCNFSM4J6LCD2Q .

tamago324 commented 4 years ago

488 has been merged, so you can output it to quickfix and location list!

tamago324 commented 4 years ago

https://github.com/thinca/vim-qfreplace is a very useful plugin. if you like please get.