Skip to content

Better documentation for persisting --type-add/--type-clear using config files. #1571

@llamasoft

Description

@llamasoft

A while back I discovered that ripgrep supports a --type-add option and I was quite excited. I find myself using the same glob patterns pretty regularly, so having a way to define common patterns seemed like it would save me a tremendous amount of time... until I saw that "Type settings are NOT persisted".
I found this rather disappointing because it meant that --type-add would only ever save time if I wrapped rg in an alias or function.
It wasn't until much later (today in fact!) that I saw that ripgrep supports configuration files. This effectively means that I can persist my type definitions.

Given the severe limitation of type definitions not being automatically persisted, I would strongly suggest updating the help text/manpages of --type-add and --type-clear to also mention the existence of using a configuration file as a workaround. Yes, the configuration file guide uses --type-add as an example, but most users may not realize that a configuration file solution exists if something doesn't point them directly to it.

In summary, I suggest changing this line:

Note that this MUST be passed to every invocation of ripgrep. Type settings are NOT persisted.

Into something like this:

Note that this MUST be passed to every invocation of ripgrep. Type settings are NOT persisted. See CONFIGURATION FILES for a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docAn issue with or an improvement to documentation.enhancementAn enhancement to the functionality of the software.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions