diff-so-fancy submodule, symlink in bin/, README.md

This commit is contained in:
Sebastian Gniazdowski 2018-02-26 12:34:24 +01:00
parent b88cf03aea
commit 8ba67c35b8
4 changed files with 41 additions and 0 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "diff-so-fancy"]
path = diff-so-fancy
url = https://github.com/so-fancy/diff-so-fancy

36
README.md Normal file
View file

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

1
bin/diff-so-fancy Symbolic link
View file

@ -0,0 +1 @@
../diff-so-fancy/diff-so-fancy

1
diff-so-fancy Submodule

@ -0,0 +1 @@
Subproject commit 0d2492c0cc81c11588040982f9544b6be8541bcb