Integrate delta into git

  |   Source

Delta is a syntax-highlighting pager for git, diff, and grep output.

Set up is as simple as copying its sample setup.

I wrote a shell script my-pager which can use both less and delta as pager,

# @see
if [ -x "$HOME/.cargo/bin/delta" ]; then
    cat | $HOME/.cargo/bin/delta "$@"
    cat | less -F -X

Here is my extra delta setup in ~/.gitconfig (Delta reads settings from ~/.gitconfig),

pager = ~/bin/my-pager
diffFilter = ~/bin/my-pager --color-only
conflictstyle = diff3
colorMoved = default
[delta "default"]
file-decoration-style= blue box
hunk-header-decoration-style = purple ol
features = default
navigate = true  # use n and N to move between diff sections

Screenshot, git-delta.png

Comments powered by Disqus