rg -B2 -A2 foo
rg -C2 foo
Perhaps for further emphasis:
grep -R -C2 foo .
Yep, edited that in as you were commenting.
Perhaps for further emphasis:
Yep, edited that in as you were commenting.