Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsApr 15, 2026·2 min de lectura

diff-so-fancy — Good-Looking Diffs for git and plain text

diff-so-fancy strips filenames, strips leading `+/-`, highlights word-level changes, and turns ugly unified diffs into clean, GitHub-style readable output — a drop-in replacement for git's default diff.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
diff-so-fancy guide
Comando de instalación directa
npx -y tokrepo@latest install 43fc75b0-38c4-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

TL;DR
Drop-in replacement for git diff that strips noise, highlights word-level changes, and produces clean readable output.
§01

What it is

diff-so-fancy is a command-line tool that transforms ugly unified diffs into clean, human-readable output. It strips redundant filename headers, removes leading +/- characters, and highlights word-level changes within each line. The result looks like a GitHub-style diff in your terminal.

The tool targets any developer who reads diffs in the terminal. It works as a drop-in replacement for git's default diff pager with zero learning curve.

§02

How it saves time or tokens

Reading standard unified diffs requires mental effort to parse +/- prefixes, track which file you are in, and spot the actual changed words within long lines. diff-so-fancy eliminates this overhead by highlighting only what changed at the word level. Reviewing pull requests and debugging commits becomes faster.

§03

How to use

  1. Install diff-so-fancy via npm, brew, or your package manager.
  2. Configure git to use it as the default pager.
  3. Run git diff as usual — the output is automatically formatted.
# Install
npm install -g diff-so-fancy
# or
brew install diff-so-fancy

# Configure git to use diff-so-fancy
git config --global core.pager 'diff-so-fancy | less --tabs=4 -RFX'
git config --global interactive.diffFilter 'diff-so-fancy --patch'

# Now just use git diff normally
git diff
git log -p
git show HEAD
§04

Example

# Standard git diff (hard to read):
- const MAX_RETRIES = 3;
+ const MAX_RETRIES = 5;

# diff-so-fancy output (word-level highlight):
# The line shows 'MAX_RETRIES = ' in normal color,
# '3' highlighted in red, '5' highlighted in green.
# No +/- prefixes. Clean file headers.
§05

Related on TokRepo

§06

Common pitfalls

  • diff-so-fancy does not work well with git add -p (interactive staging) unless you also set interactive.diffFilter; without it, the patch mode shows raw diffs.
  • Some terminal color schemes make the highlights hard to see; adjust diff-so-fancy's color settings or switch to a dark terminal theme.
  • Piping diff-so-fancy output to other tools strips the ANSI colors; use --color=always if you need to pipe through grep or less.

Preguntas frecuentes

Does diff-so-fancy work with all git commands?+

Yes. Once configured as the default pager, diff-so-fancy processes output from git diff, git log -p, git show, git stash show, and any command that produces diff output. It also works with plain diff commands outside of git.

Can I use diff-so-fancy alongside delta or bat?+

They serve similar purposes. delta is an alternative diff highlighter with syntax-aware highlighting. You typically choose one as your git pager. If you prefer delta's features, use delta. diff-so-fancy is simpler and requires less configuration.

How do I install diff-so-fancy without npm?+

diff-so-fancy is available through Homebrew (brew install diff-so-fancy), apt (on Debian/Ubuntu), and as a standalone Perl script you can download directly. It has minimal dependencies — just Perl, which is pre-installed on most Unix systems.

Does diff-so-fancy change the actual diff content?+

No. diff-so-fancy only changes the visual presentation. The underlying diff data is identical. It strips visual noise like +/- prefixes and redundant headers but does not alter which lines are shown as added, removed, or changed.

Can I customize the colors?+

Yes. diff-so-fancy respects git config color settings. You can configure colors for added lines, removed lines, changed words, and section headers through standard git config commands. The README documents all available color options.

Referencias (3)
  • diff-so-fancy GitHub— diff-so-fancy strips noise and highlights word-level changes in diffs
  • Git Documentation— Git pager configuration for custom diff output
  • GitHub Docs— Improving code review effectiveness through better diff visualization

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados