|
| 1 | +# Zsh-Diff-So-Fancy |
| 2 | + |
| 3 | +The project [so-fancy/diff-so-fancy](https://github.com/so-fancy/diff-so-fancy) is very |
| 4 | +interesting, however I find it difficult to a) install it, b) hook it up to git. |
| 5 | + |
| 6 | +For the a), I just like to install things as user, in home directory, not system-wide via |
| 7 | +package manager. So even if the package exists (like it is in e.g. Homebrew for OS X, it |
| 8 | +has `diff-so-fancy`), I try to not use it. Think about remote shell accounts, is it good |
| 9 | +to ask every system administrator to install your favorite packages? |
| 10 | + |
| 11 | +With this Zsh plugin, you simply add two lines to `.zshrc`: |
| 12 | + |
| 13 | +```zsh |
| 14 | +zplugin ice as"program" pick"bin/git-dsf" |
| 15 | +zplugin light zdharma/zsh-diff-so-fancy |
| 16 | +``` |
| 17 | + |
| 18 | +This will install `diff-so-fancy` on every account where you use Zshell, and automatically |
| 19 | +equip `git` with subcommand `dsf`. No need to use system package manager and to configure |
| 20 | +`git`. Of course, if you have the following standard line in your `.gitconfig`, it will |
| 21 | +still work normally: |
| 22 | + |
| 23 | +``` |
| 24 | +[core] |
| 25 | + pager = diff-so-fancy | less -FXRi |
| 26 | +``` |
| 27 | + |
| 28 | +(because this plugin adds `diff-so-fancy` to `$PATH`). |
| 29 | + |
| 30 | +# A Few Details |
| 31 | + |
| 32 | +[so-fancy/diff-so-fancy](https://github.com/so-fancy/diff-so-fancy) is cloned from |
| 33 | +Github as submodule. The plugin has `bin/git-dsf` script which adds subcommand `dsf` |
| 34 | +to git. That's basically everything needed: convenient way of installing (single Zsh |
| 35 | +plugin manager invocation), updating (Zsh plugin managers can easily update) and |
| 36 | +integrating with `git`. |
0 commit comments