{"id":18654490,"url":"https://github.com/z-shell/zsh-diff-so-fancy","last_synced_at":"2025-10-03T16:04:47.959Z","repository":{"id":43290677,"uuid":"423834342","full_name":"z-shell/zsh-diff-so-fancy","owner":"z-shell","description":"⚙️ The diff-so-fancy for Zsh","archived":false,"fork":false,"pushed_at":"2024-09-19T16:29:47.000Z","size":3937,"stargazers_count":22,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T16:22:57.156Z","etag":null,"topics":["awesome-zsh-plugins","diff","diff-utils","git-diff","git-difftool","zsh","zsh-plugin"],"latest_commit_sha":null,"homepage":"https://wiki.zshell.dev/ecosystem/plugins/diff-so-fancy","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/z-shell.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-02T12:26:20.000Z","updated_at":"2025-03-17T00:12:46.000Z","dependencies_parsed_at":"2023-11-25T01:32:22.528Z","dependency_job_id":"d4f6f730-43b8-4a94-8e5d-7f6217f27fca","html_url":"https://github.com/z-shell/zsh-diff-so-fancy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-shell%2Fzsh-diff-so-fancy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-shell%2Fzsh-diff-so-fancy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-shell%2Fzsh-diff-so-fancy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-shell%2Fzsh-diff-so-fancy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z-shell","download_url":"https://codeload.github.com/z-shell/zsh-diff-so-fancy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248449727,"owners_count":21105551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awesome-zsh-plugins","diff","diff-utils","git-diff","git-difftool","zsh","zsh-plugin"],"created_at":"2024-11-07T07:15:34.744Z","updated_at":"2025-10-03T16:04:47.941Z","avatar_url":"https://github.com/z-shell.png","language":"Shell","funding_links":[],"categories":["Plugins"],"sub_categories":["ZSH on Windows"],"readme":"\u003ch1 align=\"center\"\u003e\u003cp\u003e\n  \u003ca href=\"https://github.com/z-shell/zi\"\u003e\n    \u003cimg src=\"https://github.com/z-shell/zi/raw/main/docs/images/logo.png\" alt=\"Logo\" width=\"80px\" height=\"80px\" /\u003e\n  \u003c/a\u003e\n❮ Zi ❯ Plugin - zsh-diff-so-fancy\n\u003c/p\u003e\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\u003cimg align=\"center\" src=\"https://raw.githubusercontent.com/z-shell/wiki/main/static/img/gif/zsh-diff-so-fancy.gif\" alt=\"zsh-diff-so-fancy\" /\u003e\u003c/p\u003e\n\u003c/div\u003e\u003chr /\u003e\n\n# zsh-diff-so-fancy\n\nA simple plugin integrating [so-fancy/diff-so-fancy](https://github.com/so-fancy/diff-so-fancy) into Zsh. It provides:\n\n- `git dsf`: A subcommand to run Git diffs through diff-so-fancy\n- `fancy-diff`: A helper to run a unified diff and beautify it with diff-so-fancy\n\n## Quick Start\n\n1. **Install** [diff-so-fancy](https://github.com/so-fancy/diff-so-fancy#installation) or load it via your preferred method.\n2. **Load the plugin** in your `.zshrc` or plugin manager:\n   ```shell\n   # Example using Zi\n   zi ice as'program' pick'bin/*'\n   zi light z-shell/zsh-diff-so-fancy\n   ```\n3. **Use** the commands:\n   - `git dsf \u003cfiles\u003e` to see a diff rendered by diff-so-fancy\n   - `fancy-diff \u003cfile1\u003e \u003cfile2\u003e` to compare two files with diff-so-fancy\n\n## Customization\n\nYou can customize the `less` options by setting these environment variables in your `.zshrc` before loading the plugin:\n\n```shell\n# Customize less options for fancy-diff\nexport FANCY_DIFF_LESS_OPTS=\"--tabs=2 -RFX\"\n\n# Customize less options for git dsf\nexport GIT_DSF_LESS_OPTS=\"--tabs=2 -FRXS\"\n```\n\nThe default is `--tabs=4 -FRXSi` for both commands if not specified.\n\n## Manual Configuration\n\n```shell\ndiff-so-fancy --colors        # Show recommended color config\ndiff-so-fancy --set-defaults  # Configure Git to use diff-so-fancy with suggested colors\ndiff-so-fancy --patch         # Patch mode, interoperable with `git add --patch`\n```\n\n### Git Integration\n\n```shell\n# Use diff-so-fancy for all diffs\ngit config --global core.pager \"diff-so-fancy | less --tabs=4 -RFX\"\n\n# Use diff-so-fancy for `git add --patch`\ngit config --global interactive.diffFilter \"diff-so-fancy --patch\"\n```\n\n### diff-so-fancy Options\n\n- **markEmptyLines** (bool, default: true)\n  Color the first block of an empty line.\n- **changeHunkIndicators** (bool, default: true)\n  Simplify Git header chunks to a more readable format.\n- **stripLeadingSymbols** (bool, default: true)\n  Remove leading `+` or `-` from lines.\n- **useUnicodeRuler** (bool, default: true)\n  Use Unicode line-drawing characters for file headers (disable if your terminal cannot display them).\n- **rulerWidth** (int, default: full width)\n  Set a fixed width for the file header separator.\n\n### Plugin Details\n\n- Both `fancy-diff` and `git-dsf` use the `--patch` flag with `diff-so-fancy` to preserve the original diff format in the output, which is useful for interoperability with tools that parse diff output.\n- The plugin follows the [Zsh Plugin Standard](https://wiki.zshell.dev/community/zsh_plugin_standard) and provides an unload function for plugin managers that support unloading.\n- The plugin checks if `diff-so-fancy` is installed and provides a helpful warning if it's not found.\n\n### Installation with [Zi](https://github.com/z-shell/zi)\n\n```shell\nzi ice as'null' sbin'bin/*'\nzi light z-shell/zsh-diff-so-fancy\n```\n\nOr:\n\n```shell\nzi ice as'program' pick'bin/*'\nzi light z-shell/zsh-diff-so-fancy\n```\n\nThis places `diff-so-fancy`, `fancy-diff`, and `git-dsf` in `$PATH`, adding the `dsf` subcommand to Git automatically.\n\n## Other Plugin Managers\n\n- **Zplug**\n  ```shell\n  zplug \"z-shell/zsh-diff-so-fancy\", as:command, use:\"bin/\"\n  ```\n- **Zgen**\n  ```shell\n  zgen load z-shell/zsh-diff-so-fancy\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz-shell%2Fzsh-diff-so-fancy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz-shell%2Fzsh-diff-so-fancy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz-shell%2Fzsh-diff-so-fancy/lists"}