summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2022-09-29 12:50:16 -0400
committerDan Davison <dandavison7@gmail.com>2022-09-29 12:50:16 -0400
commita7bab81665828fd7aabf3b358a9bdfc652c5b31e (patch)
tree6ce9a8daf49633bb6ee10f9eed1d41f6f8bca6f7
parent1193d54d5c90ab3a45048de3fd1e95c7c2580014 (diff)
Clarify that rg --json | delta is the only fully correct grep handler
Closes #1197
-rw-r--r--manual/src/grep.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/manual/src/grep.md b/manual/src/grep.md
index 7f187080..cd1e129d 100644
--- a/manual/src/grep.md
+++ b/manual/src/grep.md
@@ -1,8 +1,6 @@
# Grep
-Delta applies syntax-highlighting and other enhancements to standard grep output such as from `git grep`, [ripgrep](https://github.com/BurntSushi/ripgrep/) (aka `rg`), grep, etc.
-To use with `git grep`, set delta as the pager for `grep` in the `[pager]` section of your gitconfig. See the example at the [top of the page](./get-started.md).
-Output from other grep tools can be piped to delta: e.g. `rg -Hn --color=always`, `grep -Hn --color=always`, etc.
+Delta applies syntax-highlighting and other enhancements to standard grep output such as from [ripgrep](https://github.com/BurntSushi/ripgrep/) (aka `rg`), `git grep`, grep, etc.
+If you don't need special features of `git grep`, then for best results pipe `rg --json` output to delta: this avoids parsing ambiguities that are inevitable with the output of `git grep` and `grep`.
To customize the colors and syntax highlighting, see `grep-match-line-style`, `grep-match-word-style`, `grep-context-line-style`, `grep-file-style`, `grep-line-number-style`.
-Ripgrep's `rg --json` output format is supported; this avoids certain file name parsing ambiguities that are inevitable with the standard grep output formats.
Note that `git grep` can display the "function context" for matches and that delta handles this output specially: see the `-p` and `-W` options of `git grep`.