ripgrep

Apr 17, 2024

For years now, I've been using ack to search for stuff via the command line (it's so much better than grep!). One of its drawbacks, however, is its reliance on having an installed Perl interpreter. In fact, ack is the only reason I have Perl installed these days. Also, like seemingly so many other projects in recent times, ack development appears to have stopped altogether. Several months ago, I stumbled upon ripgrep, a Rust-powered tool that is orders of magnitude faster than ack and friends.

I haven't been using it for long, but it looks like a worthy replacement for my previous tool of choice. For posterity, here's how I have my global configuration set up; the default colors leave a bit to be desired, especially when using a dark terminal theme, and sorting is disabled by default:

# Change the default colors
--colors=path:fg:cyan
--colors=path:style:bold
--colors=line:fg:green
--colors=line:style:bold
--colors=match:none
--colors=match:fg:0x00,0x00,0x00
--colors=match:style:bold
--colors=match:bg:yellow

# Sort by default (slows things down a bit, but awfully handy)
--sort=path

I placed the file (named .ripgreprc) in my home directory, and then referenced it by setting up an environment variable (RIPGREP_CONFIG_PATH). Lots of stuff appears to be moving to Rust for performance, and I'm thoroughly impressed with how fast this searching tool is. Be sure to check it out.

No comments (yet!)

Leave a Comment

Ignore this field:
Never displayed
Leave this blank:
Optional; will not be indexed
Ignore this field:
Both Markdown and a limited set of HTML tags are supported
Leave this empty: