Search and highlight files using ripgrep (rg) and bat.
batrg [OPTIONS] PATTERN [PATH ...]
batrg [OPTIONS] [-e PATTERN ...] [-f PATTERNFILE ...] [PATH ...]
command | batrg [OPTIONS] PATTERN
See rg
-
--snip
Show the snip decoration (seebat --style=...
).
This is automatically disabled when--context=0
(seebat
). -
--no-snip
Disable--snip
. -
--highlight
Highlight matching lines.
This is automatically disabled when--context=0
(seebat
). -
--no-highlight
Disable--highlight
. -
--file-separator=<separator>
Character used by the separation line between 2 files, or string separator. -
--file-separator-wrap
If a match is found, appends the separator line above the first file and below the last file. -
--no-file-separator-wrap
Disable--file-separator-wrap
. -
--paging=<when>
Specify when to use the pager. To control which pager is used, set thePAGER
orBAT_PAGER
environment variables (the latter takes precedence) or use the--pager
option. To disable the pager permanently, set--paging=never
.
Possible values:auto
,never
,always
,one-by-one
. -
--bat-engine=<command>
Specify command forbat
. By default useBATRG_BAT
environment variables orbat
. -
--rg-engine=<command>
Specify command forrg
. By default useBATRG_RG
environment variables orrg
.
Another options are passed directly to ripgrep
or bat
.
zsh
bat
rg
Just put batrg
in a PATH
folder and completion/_batrg
in a completion folder.