What delta Does
- Syntax highlighting — 100+ languages via syntect
- Side-by-side view — optional two-column mode
- Line numbers — in diffs
- File headers — stylized, navigable
- Navigation — jump between files with
n/N - Themes — Sublime Text themes work
- Merge conflicts — 3-way diff highlight
- Whitespace errors — visible
- git blame — also prettified
- Works with — git, diff, rg, blame
Architecture
Rust binary that reads diff/patch format on stdin and writes colorized output to stdout. Integrates with git via core.pager = delta. Syntax highlighting uses the syntect crate (Sublime .sublime-syntax compatible).
Self-Hosting
CLI tool, git pager.
Key Features
- Syntax highlighting for 100+ languages
- Side-by-side diff view
- Line numbers
- File navigation (n/N)
- Sublime theme compatibility
- Works with git diff/show/log/blame
- Integrates with rg, grep
- Dark and light modes
- Configurable via gitconfig
Comparison
| Pager | Highlighting | Side-by-side | Language |
|---|---|---|---|
| delta | Yes | Yes | Rust |
| diff-so-fancy | Yes | No | Perl |
| diff-highlight (git) | Limited | No | Perl |
| bat + diff | Yes | No | Rust |
| less | No | No | C |
常见问题 FAQ
Q: 和 diff-so-fancy? A: 功能类似。delta 速度更快(Rust)、支持 side-by-side、语法高亮更丰富。diff-so-fancy 更老牌、更简单。
Q: side-by-side 看不清?
A: 调整 max-line-length 和终端宽度。超宽的行会自动换行,窄终端建议关 side-by-side。
Q: git log 也能用?
A: 能。git log -p 会自动走 delta 的 pager。git blame 也有独立高亮。
来源与致谢 Sources
- Docs: https://dandavison.github.io/delta
- GitHub: https://github.com/dandavison/delta
- License: MIT