From 1f5ffdc306951de910024d24262dfc0cf63535c6 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 3 Jan 2022 08:26:42 -0500 Subject: Split README.md into mdbook manual github actions config copied from https://github.com/Wilfred/difftastic --- manual/src/grep.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 manual/src/grep.md (limited to 'manual/src/grep.md') diff --git a/manual/src/grep.md b/manual/src/grep.md new file mode 100644 index 00000000..00d4ce70 --- /dev/null +++ b/manual/src/grep.md @@ -0,0 +1,8 @@ +# 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). +Output from other grep tools can be piped to delta: e.g. `rg -Hn --color=always`, `grep -Hn --color=always`, etc. +To customize the colors and syntax highlighting, see `grep-match-line-style`, `grep-match-word-style`, `grep-contexct-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`. -- cgit v1.2.3