Use ripgrep in Emacs.
Ripgrep is a replacement for both grep like (search one file) and ag like (search many files) tools. It's fast and versatile and written in Rust. For some introduction and benchmarks, see ripgrep is faster than {grep, ag, git grep, ucg, pt, sift}.
This package let you run ripgrep
like grep
from within Emacs.
Invoke by M-x rg. This works the same way as M-x rgrep,
i.e. you get an interactive prompt to enter search details. Universal
argument can be used as for rgrep
.
ripgrep has its own builtin
mappings from type names to file name patterns that can be selected
from rg.el on invocation of rg
. It's also possible to specify a
custom file name pattern in the files prompt.
Name | Meaning |
---|---|
all | all defined types including rg-custom-type-aliases |
everything | all files, i.e. running rg witout --type flag |
custom | used internally in rg.el for mapping custom globs. Do not use |
this in rg-custom-type-aliases |
Custom type patterns as for rgrep are supported via customizing of
rg-custom-type-aliases
.
(setq rg-custom-type-aliases
'(("foo" . "*.foo *.bar")
("baz" . "*.baz *.qux")))
See LICENSE.