Adds diff-so-fancy, and adds 'dsf' as an extension to the git command.
Go to file
vladislav doster 5822f4996d
Merge pull request #10 from zdharma-continuum/ci/gh-action-lint-workflow
feat: add lint gh action workflows
2023-04-15 23:45:56 -05:00
.github feat: add lint gh action workflow 2023-04-14 17:11:10 -05:00
bin dsf: Correctly pass arguments from git dsf' invocation to git diff' 2018-03-01 12:43:48 +01:00
diff-so-fancy@d7dcc1715f Bump diff-so-fancy from 1f0dd53 to d7dcc17 2023-02-27 15:06:09 +00:00
.gitignore Initial commit 2018-02-26 11:55:57 +01:00
.gitmodules diff-so-fancy submodule, symlink in bin/, README.md 2018-02-26 12:34:24 +01:00
LICENSE Initial commit 2018-02-26 11:55:57 +01:00
README.md feat: add lint gh action workflow 2023-04-14 17:11:10 -05:00
zsh-diff-so-fancy.plugin.zsh Update url 2021-11-10 18:27:45 +01:00

Zsh-Diff-So-Fancy

The project 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:

zplugin ice as"program" pick"bin/git-dsf"
zplugin light zdharma-continuum/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).

Think about Puppet or Chef, i.e. about declarative approach to system configuration. In this case .zshrc is like a declarative setup guarding you will have diff-so-fancy on your accounts.

A Few Details

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.

Other plugin managers

# Zplug
zplug "zdharma/zsh-diff-so-fancy", as:command, use:"bin/"

# Zgen
zgen load zdharma/zsh-diff-so-fancy

Without as"program"-like functionality the .plugin.zsh file picks up setup and simulates adding a command to system, so Zgen and other can work.