Point ripgrep at a config file
Set a path that ripgrep reads for default arguments.
export RIPGREP_CONFIG_PATH="$HOME/.ripgreprc"ripgrep reads the file specified by `RIPGREP_CONFIG_PATH` and applies each argument line automatically.
Persist preferred flags, create custom types, and combine ripgrep with fd, fzf, git, and editors.
Store your default rg behavior in a reusable config file.
Set a path that ripgrep reads for default arguments.
export RIPGREP_CONFIG_PATH="$HOME/.ripgreprc"ripgrep reads the file specified by `RIPGREP_CONFIG_PATH` and applies each argument line automatically.
Example settings for smart case and hidden files.
--smart-case
--hidden
--glob
!node_modules/**Each line in the config file is one argument; comment lines can begin with `#`.
Persist custom type mappings across sessions.
--type-add
web:*.{html,css,js,ts,tsx}Putting `--type-add` in config saves you from repeating it on every command.
Run ripgrep without loading config defaults.
rg --no-config 'token' .This is useful when debugging an alias or a surprising default behavior.
Inspect the effective path filtering and search decisions.
rg --debug 'TODO' .`--debug` is the quickest way to see whether config options are affecting the search.
Combine rg with git, fd, fzf, and editors for faster navigation and refactors.
git ls-files -z | xargs -0 rg 'TODO'This avoids build output, vendored folders, and untracked scratch files.
git diff --name-only main...HEAD | rg '\.ts$'This is a quick way to focus on the files touched in a branch.
Combine fast file discovery with fast content search.
fd -e ts -e tsx src | xargs rg 'useQuery\('`fd` is great at path selection while ripgrep excels at content matching.
Power an interactive search UI in fzf.
fzf --bind 'change:reload:rg --line-number --no-heading --color=always {q} . || true'A classic terminal setup for IDE-like project search.
Feed matches into an editor workflow.
vim -q <(rg --vimgrep 'TODO' .)`--vimgrep` formats output specifically for Vim quickfix and similar tools.
Use output shapes built for editors and jump lists.
rg --vimgrep 'panic!' src/Many editors can parse vimgrep format directly.
rg --no-heading --line-number --column 'FIXME' .This general-purpose format works in many homegrown tools and scripts.
rg --json 'router' src/ | jqJSON output avoids brittle splitting on colons or spaces.
Prevent escape sequences from breaking consumers.
rg --color=never 'TODO' .Disable colors when the destination is not a terminal.
rg --color=always 'panic!' src/ | less -R`less -R` preserves raw ANSI colors in paged results.