Fancydiff
Colorful Git diffs for terminal and web, including source syntax highlighting
Install / Use
/learn @da-x/FancydiffREADME
Fancydiff
Fancydiff is a diff coloring wrapper for Git, under Linux or MacOS X, that supports both intra-line diffs, and source code syntax highlighting.
<img src="doc/fancydiff-example.png">This similar to what you see on Github, but instead it is done in the user's console.
Download and install
Linux
First make sure that you have a terminal program that supports 24 bit True Color (see this gist).
Ubuntu users of URxvt can install from my build of urxvt on Launchpad,
Fedora/CentOS users can use my patched builds of URxvt installable from Copr.
Latest binaries of Fancydiff can be installed on major distributions.
On Fedora 22 onwards:
sudo dnf copr enable alonid/fancydiff
sudo dnf install fancydiff
For EPEL/CentOS/Red Hat 7, visit Copr.
On Ubuntu:
sudo add-apt-repository ppa:alonid/fancydiff
sudo apt-get update
sudo apt-get install fancydiff
You can also visit Fancydiff's PPA in Launchpad.
MacOS X
Download a test release or a nightly of iTerm2, which supports 24-Bit True Color ANSI codes. Then, do the following:
brew install https://raw.githubusercontent.com/da-x/fancydiff/brew-lastest/fancydiff.rb
Or, compile from source
Follow the building instructions.
Git configuration
With fancydiff in $PATH you can use the setup command to modify the Git configuration.
fancydiff setup [--local] [--aliases]
More details here about how the Git configuration is modified to enable Fancydiff.
Using with less, independent of Git
Add the following line to one of your shell initialization scripts:
export LESSOPEN="|fancydiff file %s -e"
Limitations
- Too few source code languages are supported (currently: C/C++, Haskell, Python, Java, JavaScript, Go).
- Some small original coloring features from Git itself are missing.
- Some special Git modes don't use the pager (e.g.
git checkout -p, in which Fancydiff is not presently activated. - 3-way diff is not yet supported.
Contribution and bug reports
Everyone is welcome to contribute and report issues here via Github!
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
