If you type the same flags after rg all day, put them in a file. ripgrep doesn’t look for one on its own, so you tell it where to find it with an environment variable.
Create ~/.ripgreprc with one argument per line:
--smart-case
--glob=!node_modules/*
--max-columns=200
Then point ripgrep at it from your shell startup file:
export RIPGREP_CONFIG_PATH="$HOME/.ripgreprc"
Now a plain search follows those rules. With smart case, a lowercase pattern also finds capitals, and a pattern with a capital in it stays strict. Lines that start with # in the file are comments.
The format is strict about one thing: each line is a single argument. Write --max-columns=200 with the equals sign, or put the flag and its value on two lines. A line with a space in the middle is passed as one odd argument and fails.
When a result looks off, or you can’t find something you know is there, rule the file out first:
rg --no-config pattern
I’d also keep the file short. Hidden filters are easy to forget, and scripts that call rg on your machine pick up the same settings, so add --no-config in scripts that must behave the same everywhere.
Further reading: ripgrep user guide
Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more