Skip to content

Commit 0e898fe

Browse files
committed
Fixes #42: Don't use diff-so-fancy for core pager
1 parent 1e57009 commit 0e898fe

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

readme.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ You can do one-off fanciness:
1919
git diff --color | diff-so-fancy
2020
```
2121

22-
**But**, you'll probably want to fancify all your diffs. Run this so `git diff` will use it:
22+
**But**, you'll probably want to fancify all your diffs. Run this so `git diff` and `git show` will use it:
2323
```shell
24-
git config --global core.pager "diff-so-fancy | less --tabs=1,5 -R"
24+
git config --global pager.diff "diff-so-fancy | less --tabs=1,5 -R"
25+
git config --global pager.show "diff-so-fancy | less --tabs=1,5 -R"
2526
```
2627

2728
Or, create a git alias in your `~/.gitconfig` for shorthand fanciness:
@@ -44,7 +45,7 @@ If you want, you can choose to install manually:
4445
* Grab the two scripts (`diff-highlight` and `diff-so-fancy`) via either downloading or cloning the repo.
4546
* If you download `diff-highlight` from the official git repo, make sure it's executable.
4647
* Symlink or place them in a location that is in your `PATH`.
47-
* Set up the git `core.pager` config, as described above.
48+
* Set up the git `pager.diff` and `pager.show` configs, as described above.
4849

4950
Note: The `diff-highlight` dependency is an [official git-contrib script](https://github.com/git/git/tree/master/contrib/diff-highlight), duplicated here for convenience. If you prefer less fancy in your diff, you also use diff-highlight [on it's own](https://news.ycombinator.com/item?id=11068436).
5051

@@ -68,10 +69,10 @@ You may also want to configure [general diff colors](https://github.com/pauliris
6869

6970
## Opting-out
7071

71-
Sometimes you will want to bypass diff-so-fancy. Easy enough:
72+
Sometimes you will want to bypass diff-so-fancy. Use `--no-pager` for that:
7273

7374
```shell
74-
git --no-pager diff # will avoid core.pager hook
75+
git --no-pager diff
7576
```
7677

7778

0 commit comments

Comments
 (0)