Skip to content

Commit 05cb2ca

Browse files
committed
readme: refactor for clarity.
1 parent f2667d1 commit 05cb2ca

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

readme.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ diff-so-fancy builds on the good-lookin' output of diff-highlight to upgrade you
66

77
## Screenshot
88

9-
*diff-highlight (default) vs diff-so-fancy*
9+
*`git diff` vs `git diff | diff-so-fancy`*
1010

1111
![diff-highlight vs diff-so-fancy](https://cloud.githubusercontent.com/assets/39191/10000682/8e849130-6052-11e5-9bd9-bd4505cd24d6.png)
1212

@@ -23,30 +23,34 @@ git config --global core.pager "diff-highlight | diff-so-fancy | less -r"
2323

2424
## Install
2525

26-
GNU sed. On Mac, install it with Homebrew:
2726
```shell
28-
brew install gnu-sed --with-default-names # You'll have to change below to `gsed` otherwise
27+
npm install -g diff-so-fancy
2928
```
29+
This will install and link the `diff-so-fancy` and `diff-highlight` scripts.
3030

31-
diff-highlight. It's shipped with Git, but probably not in your `$PATH`:
31+
### GNU sed.
32+
On Mac, install it with Homebrew.
3233
```shell
33-
ln -sf "$(brew --prefix)/share/git-core/contrib/diff-highlight/diff-highlight" ~/bin/diff-highlight
34+
brew install gnu-sed --with-default-names # You'll have to change below to `gsed` otherwise
3435
```
3536

36-
Add some coloring to your .gitconfig:
37+
### Git config color
3738
```
3839
git config --global color.diff-highlight.oldNormal "red bold"
3940
git config --global color.diff-highlight.oldHighlight "red bold 52"
4041
git config --global color.diff-highlight.newNormal "green bold"
4142
git config --global color.diff-highlight.newHighlight "green bold 22"
4243
```
44+
You may also want to configure [general diff colors](https://github.com/paulirish/dotfiles/blob/63cb8193b0e66cf80ab6332477f1f52c7fbb9311/.gitconfig#L23-L36).
4345

44-
### npm
45-
46+
### `diff-highlight`
47+
It's installed via the `diff-so-fancy` npm package. But it's also shipped with Git so, if you prefer, you can add it to your `$PATH` manually:
4648
```shell
47-
npm install -g diff-so-fancy
49+
ln -sf "$(brew --prefix)/share/git-core/contrib/diff-highlight/diff-highlight" ~/bin/diff-highlight
50+
# confirm that ~/bin is in your PATH
4851
```
4952

53+
5054
## Credit
5155

5256
Extracted from https://github.com/paulirish/dotfiles/blob/master/bin/diff-so-fancy

0 commit comments

Comments
 (0)