cloudhead / neovim-fuzzy

Minimalistic fuzzy file finding for neovim
BSD 3-Clause "New" or "Revised" License
111 stars 17 forks source link

FuzzyGrep should grep content only, not filenames. #23

Closed insidewhy closed 6 years ago

insidewhy commented 7 years ago

Or at least there should be an option to let you select whether filenames are also matched.

I often use the grep feature of my old plugin to grab the files that have included another file, with the way :FuzzyGrep currently works it obfuscates the results I want.

insidewhy commented 7 years ago

I can sort the PR out for this easy, just opening the issue to make sure there's interest.

cloudhead commented 7 years ago

Last time I looked into this I didn't find a way to do it. How would you approach it?

cloudhead commented 7 years ago

We can have rg not output filenames at all with -N but not sure if that's what we want? I mimicked the behaviour of fzf originally which includes the filename/line I guess because that provides utility.

insidewhy commented 7 years ago

You'd need to remove the filename before piping the text through fzy, and then know which filename to reattach to the results. fzy is quite light on options though so maybe it's not even possible.

I'm trying to get an -a option added to fuzzy that would allow neovim-fuzzy to open "all matches" instead of a single match. If the author is receptive to that then maybe I can get other options we'd need to improve neovim-fuzzy.

insidewhy commented 7 years ago

@cloudhead Hm you could filter all the matches in vim, remove the ones where only the filename (before the first colon) matches and not the content.

cloudhead commented 6 years ago

I'm going to close this - it may be possible, but filtering everything in vim seems like it will be a performance issue.