camspiers / snap

A fast finder system for neovim.
The Unlicense
481 stars 16 forks source link

Add ripgrep producer alternative for line-based grep #66

Closed spywhere closed 3 years ago

spywhere commented 3 years ago

A grep with --vimgrep will produce duplicate lines as there are multiple matches within the same line. While the introduced ripgrep.vimgrep.line producer will produce only a single line per match, regardless of multiple matches within the same line. This should help in a case where only line matches are needed, and to not waste processing power to the filtering.

IMG_8422

camspiers commented 3 years ago

This genuinely awesome, thanks!

gegoune commented 3 years ago

How to use that with snap.maps? Also, there is no documentation at all. Is it meant to be active by default?

camspiers commented 3 years ago

It's optional, at the moment it isn't documented, you can use it with snap.maps as you would any custom function. Something like:

snap.maps {
  {"<Leader>g", snap.config.vimgrep {
    producer = snap.get"producer.ripgrep.vimgrep".line {},
  }}
}