Skip to content

Commit 767ea02

Browse files
Merge pull request #358 from martijnengler/next
Add info about using dsf as a "normal" diff tool
2 parents f4f4eef + 7cd8f4c commit 767ea02

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ Installation is as simple as cloning this repo and then putting the `diff-so-fan
1818

1919
## Usage
2020

21+
diff-so-fancy can be used with the standard `diff` tool, and can even be configured as the default for diffs with git.
22+
23+
### With diff
24+
25+
Use `-u` with diff to for unified output, and pipe the output to `diff-so-fancy`:
26+
27+
```shell
28+
diff -u file_a file_b | diff-so-fancy
29+
```
30+
31+
You could, of course, create a function for it too. In your `~/.bashrc` or `~/.zshrcz` for example:
32+
33+
```shell
34+
function dsf() { diff -u "$1" "$2" | diff-so-fancy; }
35+
```
36+
37+
And than you can just type `dsf file_a file_b` to get nice looking diff output.
38+
39+
### With git
40+
2141
Configure git to use `diff-so-fancy` for all diff output:
2242

2343
```shell

0 commit comments

Comments
 (0)