/rg.el

Emacs frontend to ripgrep

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

rg.el

License GPL 3

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.

Usage

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.

Mappings with special meaning

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

Customize

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")))

License

See LICENSE.