by burntsushi · 2y ago · 0 comments
$ cat ~/bin/rgp
#!/bin/sh
exec rg -p "$@" | less -RFX
Should work just fine. For Windows, you can install `bat` to use a pager if you don't otherwise have one. You don't need GNU utils to have a pager. fan of your tool. like it's speed and defaults.
I use windows : didn't understand what you mean by "install `bat`" to use a pager.I use cygwin and WSL for my unix needs. I have more and less in cygwin for use in windows.
bat is fancy pager written in Rust. It's on GitHub: https://github.com/sharkdp/bat
Two pallets that should work on Windows are https://github.com/walles/moar (golang) and https://github.com/markbt/streampager (Rust). There might also be a newer one that uses rust, I'm unsure.
bat on Windows does page, but I believe it's only available on Choco and not winget.