delta

A syntax-highlighting pager for git, diff, grep, and blame output.

Screenshot of delta

delta is a viewer for git and diff output that brings syntax highlighting, line numbering, side-by-side diffs, and a navigable interface to your everyday git workflow. It plugs directly into git as a pager, so you get beautiful diffs with zero changes to your existing commands.

Features

  • Syntax highlighting — full language-aware highlighting inside diffs, powered by the same engine as bat
  • Side-by-side mode — view old and new versions of a file next to each other
  • Line numbers — shown in both the old and new file columns
  • Navigate between files — jump between changed files with n / N in the pager
  • Merge conflict highlighting — clearly distinguishes all three sides of a conflict
  • Hyperlinks — optionally renders file paths as clickable links in supported terminals
  • Themes — ships with several built-in themes and supports full customisation via ~/.gitconfig
  • Works with grep and blame — not just diff

Installation

cargo install git-delta

Or via your package manager:

# Debian/Ubuntu
apt install git-delta

# macOS
brew install git-delta

# Arch Linux
pacman -S git-delta

Setup

Add delta as git's default pager in ~/.gitconfig:

[core]
    pager = delta

[interactive]
    diffFilter = delta --color-only

[delta]
    navigate = true    # use n and N to move between diff sections
    side-by-side = true

[merge]
    conflictstyle = diff3

[diff]
    colorMoved = default

Usage

Once configured, delta works automatically with your usual git commands:

git diff
git show
git log -p
git blame
git grep "some pattern"

To temporarily disable it:

git --no-pager diff

To try a different theme:

delta --themes   # list available themes
GIT_PAGER="delta --theme=gruvbox-dark" git diff