# delta — Syntax-Highlighting Pager for Git Diff and Grep > delta is a syntax-highlighting pager for git, diff, grep, and rg output. Beautiful side-by-side diffs with language-aware highlighting, line numbers, and theming. Drop-in replacement for the default git pager. ## Install Save in your project root: ## Quick Use ```bash # Install brew install git-delta # macOS cargo install git-delta # Rust sudo apt install git-delta # Debian 13+ ``` Configure git to use delta (`~/.gitconfig`): ```ini [core] pager = delta [interactive] diffFilter = delta --color-only [delta] navigate = true light = false side-by-side = true line-numbers = true syntax-theme = Dracula [merge] conflictstyle = diff3 [diff] colorMoved = default ``` Use with other tools: ```bash git diff # Uses delta automatically git show HEAD # Uses delta rg --json pattern | delta # Colorized ripgrep output diff -u a.txt b.txt | delta # Generic diff ``` ## Intro delta is a syntax-highlighting pager for git, diff, and grep output. Written in Rust by Dan Davison. Drop-in replacement for the default git pager that transforms ordinary diff output into beautiful side-by-side views with syntax highlighting, line numbers, and language-aware theming. - **Repo**: https://github.com/dandavison/delta - **Stars**: 30K+ - **Language**: Rust - **License**: MIT ## 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 --- Source: https://tokrepo.com/en/workflows/224cd8c0-35d4-11f1-9bc6-00163e2b0d79 Author: AI Open Source