1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
Commit Graph

12 Commits

Author SHA1 Message Date
Andrew Gallant
c57d0fb4e8 config: add persistent configuration
This commit adds support for reading configuration files that change
ripgrep's default behavior. The format of the configuration file is an
"rc" style and is very simple. It is defined by two rules:

  1. Every line is a shell argument, after trimming ASCII whitespace.
  2. Lines starting with '#' (optionally preceded by any amount of
     ASCII whitespace) are ignored.

ripgrep will look for a single configuration file if and only if the
RIPGREP_CONFIG_PATH environment variable is set and is non-empty.
ripgrep will parse shell arguments from this file on startup and will
behave as if the arguments in this file were prepended to any explicit
arguments given to ripgrep on the command line.

For example, if your ripgreprc file contained a single line:

    --smart-case

then the following command

    RIPGREP_CONFIG_PATH=wherever/.ripgreprc rg foo

would behave identically to the following command

    rg --smart-case foo

This commit also adds a new flag, --no-config, that when present will
suppress any and all support for configuration. This includes any future
support for auto-loading configuration files from pre-determined paths
(which this commit does not add).

Conflicts between configuration files and explicit arguments are handled
exactly like conflicts in the same command line invocation. That is,
this command:

    RIPGREP_CONFIG_PATH=wherever/.ripgreprc rg foo --case-sensitive

is exactly equivalent to

    rg --smart-case foo --case-sensitive

in which case, the --case-sensitive flag would override the --smart-case
flag.

Closes #196
2018-02-04 10:40:20 -05:00
Balaji Sivaraman
f007f940c5 search: add support for searching compressed files
This commit adds opt-in support for searching compressed files during
recursive search. This behavior is only enabled when the
`-z/--search-zip` flag is passed to ripgrep. When enabled, a limited set
of common compression formats are recognized via file extension, and a
new process is spawned to perform the decompression. ripgrep then
searches the stdout of that spawned process.

Closes #539
2018-01-30 09:13:53 -05:00
dana
58bdc366ec printer: add --passthru flag
The --passthru flag causes ripgrep to print every line,
even if the line does not contain a match. This is a
response to the common pattern of `^|foo` to match every
line, while still highlighting things like `foo`.

Fixes #740
2018-01-11 18:45:51 -05:00
Balaji Sivaraman
ba1023e1e4 printer: add support for line number alignment
Closes #544
2018-01-01 09:00:31 -05:00
Dan Fabulich
beb010d004 doc: clarify --with-filename behavior with --heading 2017-09-06 08:25:05 -04:00
dana
40bacbcd7c Add -x/--line-regexp (#520)
add -x/--line-regexp flag
2017-08-09 06:53:35 -04:00
dana
4c41e9225b Make completion support short-option values in same word; handle debug variable 2017-07-26 09:30:14 -04:00
dana
5613df3034 Refactor zsh completion function
- Improve documentation
- Reorganise into functions
- Order options lexicographically
- Correct minor wording inconsistencies
- Fix --count error
- Fix --maxdepth error
- Fix --path-separator error
- Fix --version error
- Adjust exclusivity for --files, -h, -j, -o, -r, -t, -T, -v, -V, &c.
- Improve pattern-operand guard behaviour
- Partially fix issue with colorspec state
- Fix issue with typespec state
- Add completion for <type>:include: sequence
- Move licence info out of the way
2017-07-18 07:03:36 -04:00
dana
170c078440 Add -f to completions 2017-07-06 19:00:35 -04:00
dana
dd3df0ded7 Add --iglob to zsh completion function 2017-07-03 08:21:38 -04:00
dana
62a182af78 Improve zsh completion function
- Add missing options
- Fix confusion between --count and --max-count
- Improve wording consistency (capitalisation, punctuation, contractions, &c.)
- Add completion for encodings
- Add completion for colour specs
- Add partial completion for type specs
2017-07-03 07:15:21 -04:00
Fangrui Song
2628c8f38e Add Zsh completion file 2017-05-29 16:55:03 -04:00