Skip to content

Commit 8ba67c3

Browse files
committed
diff-so-fancy submodule, symlink in bin/, README.md
1 parent b88cf03 commit 8ba67c3

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "diff-so-fancy"]
2+
path = diff-so-fancy
3+
url = https://github.com/so-fancy/diff-so-fancy

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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`.

bin/diff-so-fancy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../diff-so-fancy/diff-so-fancy

diff-so-fancy

Submodule diff-so-fancy added at 0d2492c

0 commit comments

Comments
 (0)