LinuxmacOSWindows

Where Is the ripgrep Config File?

ripgrep reads extra flags from the file named by RIPGREP_CONFIG_PATH, commonly ~/.ripgreprc in home.

Last updated

ripgrep has no fixed config path. It reads one flag per line from whatever file the RIPGREP_CONFIG_PATH variable names. Convention points it at .ripgreprc in your home directory.

Without the variable set there is no config at all, which surprises users coming from grep aliases. Shell flags beat file flags beat defaults. Keep the file in dotfiles repos for consistent searching everywhere.

Where ripgrep stores this, by platform

Linux
~/.ripgreprc

Conventional path wired through RIPGREP_CONFIG_PATH in shell profile. One flag per line without the rg prefix. Unset variable means no config.

macOS
~/.ripgreprc

Same convention on Mac regardless of install method. Globs and type filters are the common entries. Verify with rg --help after edits.

Windows
C:\Users\[username]\.ripgreprc

Same file under your profile with the variable set per shell. PowerShell and Git Bash each need the variable exported.

Frequently asked questions

Why is my ripgrep config ignored?

The variable is unset or points elsewhere in that shell. Echo RIPGREP_CONFIG_PATH to confirm. Each line holds one flag without the leading dashes doubled.

What belongs in a ripgreprc?

Smart case, hidden files, and glob excludes you always want. Project specifics belong in .ignore files instead. Keep the global file short and portable.

Notice an outdated path? Let us know.