diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..89f9c1d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "diff-so-fancy"] + path = diff-so-fancy + url = https://github.com/so-fancy/diff-so-fancy diff --git a/README.md b/README.md new file mode 100644 index 0000000..c91f81a --- /dev/null +++ b/README.md @@ -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`. diff --git a/bin/diff-so-fancy b/bin/diff-so-fancy new file mode 120000 index 0000000..5a3720c --- /dev/null +++ b/bin/diff-so-fancy @@ -0,0 +1 @@ +../diff-so-fancy/diff-so-fancy \ No newline at end of file diff --git a/diff-so-fancy b/diff-so-fancy new file mode 160000 index 0000000..0d2492c --- /dev/null +++ b/diff-so-fancy @@ -0,0 +1 @@ +Subproject commit 0d2492c0cc81c11588040982f9544b6be8541bcb