diff options
author | Dan Davison <dandavison7@gmail.com> | 2022-01-03 08:26:42 -0500 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2022-01-15 19:27:24 -0500 |
commit | 1f5ffdc306951de910024d24262dfc0cf63535c6 (patch) | |
tree | 43e0114ae80efcd59a09df43f1b6665b9eb59804 /manual/src/grep.md | |
parent | df00e4ad190f789f9166024f796e357b8c642217 (diff) |
Split README.md into mdbook manual
github actions config copied from https://github.com/Wilfred/difftastic
Diffstat (limited to 'manual/src/grep.md')
-rw-r--r-- | manual/src/grep.md | 8 |
1 files changed, 8 insertions, 0 deletions
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`. |