1

How can I configure my ~/.ripgreprc glob(s) to always search from the home directory regardless of where I run rg from?

lovelikelando
  • 7,593
  • 6
  • 32
  • 50

1 Answers1

3

I'm pretty sure you can't configure ripgrep to do that, and it would be a bad idea to do that if you could, but you can make a shell function to do what you want.

Put this in your ~/.bashrc:

function rgh()
{
    rg "$@" ~/
}

Then you just rgh whatever and it will expand to rg whatever ~/.

(I chose rgh for "ripgrep home" but you can call it whatever you want.)

Andy Lester
  • 91,102
  • 13
  • 100
  • 152