share/ (e.g., conf.mycommand)regexp=REGEX
colours=COLOR1,COLOR2,...
echo "ERROR: Something went wrong" | RGRC_DEV_SHARE=1 cargo run -- --color on -c conf.mycommand
RGRC_DEV_SHARE=1 makes rgrc search share/ next to the repo; without it
only user ($XDG_CONFIG_HOME/rgrc) and system paths are searched.
-c also runs a command when one is given:
RGRC_DEV_SHARE=1 cargo run -- --color on -c conf.mycommand mycommand --arg
etc/rgrc.conf; colorization picks it up from there.
Optionally add the name to SUPPORTED_COMMANDS in src/utils.rs so
--aliases covers it; whitelist_entries_are_mapped keeps the two in sync.Conf files are searched in this order (first match wins, embedded configs last):
$XDG_CONFIG_HOME/rgrc (default ~/.config/rgrc)$XDG_DATA_HOME/rgrc (default ~/.local/share/rgrc)$XDG_CONFIG_DIRS/rgrc, $XDG_DATA_DIRS/rgrc (system defaults apply)~/.config/grc, /usr/share/grc, …)Mapper files (rgrc.conf) are searched the same way. Patterns match the full
command line first, then the bare command name, so ^df$ also matches df -h.
# Run tests
make test
# Run tests with coverage
make cov
make check
make install
# Uninstall
make uninstall
# Match only once per line
regexp=^\s*#
colours=cyan
count=once
# Replace matched text (with backreferences)
regexp=(ERROR|WARN|INFO)
colours=red,yellow,green
replace=[\1]
# Stop processing after match
regexp=^FATAL
colours=red,bold
count=stop
Count options: once, more (default), stop
Replace: Supports \1, \2, etc.
Beyond the 8 base colors and their bright_* variants:
# 256-color (0-255), grc-compatible
colours=colour_140
colours=on_colour_140
# truecolor hex
colours=rgb:ff8800
colours=on_rgb:ff8800
Both colour_ and color_ (American spelling) are accepted.