diff-so-fancy

Good-lookin' diffs. A tool that makes your diffs human-readable instead of machine-readable.

Código AbertoTerminal
Windows, macOS, Linux⭐⭐Free (MIT License)

Descrição

diff-so-fancy is a terminal-based diff viewer that makes your diffs human-readable instead of machine-readable. It strips away the leading characters (+/-) and adds spacing for better readability. It works as a filter for git diff output, transforming it into something much easier to read.

Recursos principais

  • Word-level diffs instead of line-level for better change visibility
  • Clean output without + and - prefixes cluttering the view
  • Seamless Git integration with simple configuration
  • Customizable colors and formatting to match your preferences
  • Works with any pager (less, more, etc.)
  • Automatically detects and highlights moved code blocks
  • Smart indentation preservation

Instalação

npm install -g diff-so-fancy

# Or using Homebrew on macOS:
brew install diff-so-fancy

# Then configure Git:
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

Uso

# Use with git diff
git diff | diff-so-fancy

# Configure as default pager
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

# Then just use git normally
git diff
git show HEAD~1

Vantagens

  • +Extremely easy to install and configure
  • +No learning curve - works with existing git workflow
  • +Makes terminal diffs much more readable
  • +Lightweight and fast
  • +Works with all git commands that produce diffs

Desvantagens

  • -Terminal-only, no GUI
  • -Limited to text files
  • -No merge capabilities
  • -Requires Node.js or Perl