gustavo-hms / peneira

A fuzzy finder crafted for Kakoune
GNU Lesser General Public License v2.1
35 stars 6 forks source link

Grep filter #13

Closed eko234 closed 5 months ago

eko234 commented 2 years ago

Implements a fuzzy "grep" filter for peneira.

gustavo-hms commented 2 years ago

Hi, @eko234 ! Thanks for your help!

I'd like to suggest some changes to peneira-grep:

  1. It would make more sense if it accepts a (single) argument telling what term to search for, as you would do when using grep from the command line. For instance, say I'm looking for all lines on all files that have the word interessante. I would then call peneira-grep interessante;
  2. If the user doesn't provide any argument, then the command would use the contents of the main selection by default;
  3. The searched term would be highlighted on the peneira buffer.

For the first item, I've sketched a very basic implementation in #5. You can take a look at it for an inspiration. But just to make it clear: your implementation using cut and sed is as nice as the one I've sketched using lua: there's no need to change that.

Regarding the third item, I can show you how to make a highlighter for that if you need some help.