Open spywhere opened 3 years ago
It's documented I the README, search for steps.
Subsequent configured steps can be activated using C-q. You might need to change the -M parameter via vimgrep args if you find not enough content for each line is being placed in the results buffer.
This setup looks good to me...
snap.run {
producer = snap.get'producer.ripgrep.vimgrep',
steps = {{
consumer = snap.get'consumer.fzf',
config = {prompt = "FZF>"}
}},
select = snap.get'select.vimgrep'.select,
multiselect = snap.get'select.vimgrep'.multiselect,
views = {snap.get'preview.vimgrep'}
}
It working great if I did some filtering with ripgrep first. However, if I open up the ripgrep then C-q immediately, fzf is taking some time to do the processing, and even throwing some errors. Not sure if there is too much result to be processed here.
With filtering first,
https://user-images.githubusercontent.com/1087399/123526744-18bfdc00-d704-11eb-9754-0b65e6509103.mov
Without filtering first,
https://user-images.githubusercontent.com/1087399/123526750-2aa17f00-d704-11eb-92c8-a6c5baebf89c.mov
Interesting, I suspect that it is only working when it has all the results. I need to iterate on this apparently. For now I think it's only going to work when you have all the results from ripgrep. Apologies.
No worry, I can live with it for now. Thanks for the great plugin by the way, I really like how things get composed together.
I've recently released a new configuration API which generates fucntions that call snap.run with reasonable configuration given a minimal API (less verbose). Under the hood it's really just doing all the appropriate composition and calling snap.run but it makes making mappings easier for common use cases. It's now documented in the readme. However it doesn't support steps/next yet.
Let me know what you think if you give it a try.
This issue (https://github.com/camspiers/snap/issues/1) seems to be exactly what I'm looking for, which is also seems to be the solution suggested above.
Is it possible to search a grep result using another consumer?
This setup is not quite working for me...
The flow is
Which in turn similar to just a ripgrep filtering, but it only run a ripgrep command once.