• Stars
    star
    16,720
  • Rank 1,667 (Top 0.04 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

image

CI Coverage Status Gitter

Get Started

Install it (the package is called "git-delta" in most package managers, but the executable is just delta) and add this to your ~/.gitconfig:

[core]
    pager = delta

[interactive]
    diffFilter = delta --color-only

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

    # delta detects terminal colors automatically; set one of these to disable auto-detection
    # dark = true
    # light = true

[merge]
    conflictstyle = diff3

[diff]
    colorMoved = default

Delta has many features and is very customizable; please see the user manual.

Features

  • Language syntax highlighting with the same syntax-highlighting themes as bat
  • Word-level diff highlighting using a Levenshtein edit inference algorithm
  • Side-by-side view with line-wrapping
  • Line numbering
  • n and N keybindings to move between files in large diffs, and between diffs in log -p views (--navigate)
  • Improved merge conflict display
  • Improved git blame display (syntax highlighting; --hyperlinks formats commits as links to hosting provider etc. Supported hosting providers are: GitHub, GitLab, SourceHut, Codeberg)
  • Syntax-highlights grep output from rg, git grep, grep, etc
  • Support for Git's --color-moved feature.
  • Code can be copied directly from the diff (-/+ markers are removed by default).
  • diff-highlight and diff-so-fancy emulation modes
  • Commit hashes can be formatted as terminal hyperlinks to the hosting provider page (--hyperlinks). File paths can also be formatted as hyperlinks for opening in your OS.
  • Stylable box/line decorations to draw attention to commit, file and hunk header sections.
  • Style strings (foreground color, background color, font attributes) are supported for >20 stylable elements, using the same color/style language as git
  • Handles traditional unified diff output in addition to git output
  • Automatic detection of light/dark terminal background

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

Code evolves, and we all spend time studying diffs. Delta aims to make this both efficient and enjoyable: it allows you to make extensive changes to the layout and styling of diffs, as well as allowing you to stay arbitrarily close to the default git/diff output.

image
delta with line-numbers activated
image
delta with side-by-side and line-numbers activated

Here's what git show can look like with git configured to use delta:


image image
"Dracula" theme "GitHub" theme


Syntax-highlighting themes

All the syntax-highlighting color themes that are available with bat are available with delta:


image image
delta --show-syntax-themes --dark delta --show-syntax-themes --light

Side-by-side view

[User manual]

[delta]
    side-by-side = true

By default, side-by-side view has line-numbers activated, and has syntax highlighting in both the left and right panels: [config]

image

Side-by-side view wraps long lines automatically:

image

Line numbers

[User manual]

[delta]
    line-numbers = true
image

Merge conflicts

[User manual]

image

Git blame

[User manual]

image

Ripgrep, git grep

[User manual]

image

Installation and usage

Please see the user manual and delta --help.

More Repositories

1

magit-delta

Use delta (https://github.com/dandavison/delta) when viewing diffs in Magit
Emacs Lisp
239
star
2

xenops

An editing environment for LaTeX mathematical documents
Emacs Lisp
217
star
3

chronologer

Visualize performance benchmarks over git commit history
Python
189
star
4

trogon

A bird vocalization ID quiz for the species present at any location in the world
Vue
80
star
5

iterminator

Command-line color theme selector for iTerm2
Python
25
star
6

iterm2-dwim

iTerm2 click handler
Python
22
star
7

minimal

Minimalist appearance for Emacs
Emacs Lisp
22
star
8

open-in-editor

Open a local file from a URL at a line number in an editor/IDE
Python
20
star
9

shell-config

Bash configuration
Shell
8
star
10

emacs-config

My emacs config
Emacs Lisp
6
star
11

nushell-config

nushell config
Nu
6
star
12

shellfish

Parallel PCA for large datasets
C
6
star
13

eplot

http://liris.cnrs.fr/christian.wolf/software/eplot/index.html#download
Ruby
5
star
14

dotfiles

My dotfiles
JavaScript
5
star
15

org-fold

Save folding state of Emacs Org-mode files
Emacs Lisp
5
star
16

mathematics

Notes on maths
TeX
4
star
17

selenium-capture-traffic

Capture network traffic during a selenium test
Python
3
star
18

scraper

popular stories from political news sites
CoffeeScript
3
star
19

paredit-c

Emacs paredit for C-like languages (experimental)
Emacs Lisp
3
star
20

org-buffers

Buffer links and buffer listing for Org-mode
Emacs Lisp
3
star
21

ngrams

Some tools for working with Google's ngram time series data
Python
3
star
22

org-devel

Org-mode public development repository
Emacs Lisp
2
star
23

elaenia

Bird audio machine learning experiments
Python
2
star
24

emacs-search-files

An emacs package for searching and quickly narrowing down results.
Emacs Lisp
2
star
25

optimistic-reload

A python hot-reloader experiment
Python
2
star
26

sylph

Machine learning pipelines for audio classification
Python
2
star
27

misc

Jupyter Notebook
2
star
28

bin

Command-line utilities
Shell
2
star
29

fopnp

https://github.com/brandon-rhodes/fopnp/tree/m/playground
Puppet
2
star
30

calc-II

Jupyter Notebook
1
star
31

pylast

A clone of Amr Hassan's pylast: a python interface to last.fm (and other api-compatible websites)
Python
1
star
32

pocket

pocket export
HTML
1
star
33

django-devkernel

Run a Jupyter python kernel in the Django runserver process
Python
1
star
34

feeder

Python
1
star
35

psi

Parallel Structure Inference
C
1
star
36

sandbox

1
star
37

_owldock

TypeScript
1
star
38

dbm

Similarity-based playlists and music library navigation for rockbox
Python
1
star
39

PoBI

PoBI analysis
R
1
star
40

chrome-cli-utils

Shell utilities for working with Google Chrome web browser
Shell
1
star
41

music-graph

Similar-artists navigation for a personal music collection
Python
1
star
42

dandavison.github.io

https://dandavison.github.io
HTML
1
star
43

website

My website
Emacs Lisp
1
star
44

dedpy

Python utilities
Python
1
star
45

wtccc2-analyse

Analysis of WTCCC2 genotype data
Python
1
star
46

treesync

Rapid content-blind syncing of directory trees
Python
1
star
47

addtags

Chrome extension providing buttons to wrap textarea selection with HTML tags
CoffeeScript
1
star
48

vte-ansi-tools

An iterator interface to the vte ANSI parser from the Alacritty terminal emulator
Rust
1
star
49

aslink

Approximate Single-Linkage Clustering
1
star
50

lines

Efficient selective printing of lines in a file
C
1
star
51

tringa-test

Python
1
star