rg -B2 -A2 foo
can be written as

  rg -C2 foo
although this does not underline your point as much.

Perhaps for further emphasis:

  grep -R -C2 foo .

Yep, edited that in as you were commenting.