Better diffs in Lazygit with delta

If you useLazygitas your terminal Git UI, you know how convenient it is for staging, committing, and managing branches.

I use it in Neovim (LazyVim already configures it).

Integrating a custom pager (Lazygit Custom Pagers Documentation) can dramatically improve how diffs are displayed.

In this blog post, I’ll document how to usedelta: a syntax-highlighting pager for git, diff, and grep output.

Delta makes diffs much more readable by adding syntax highlighting, line numbers, and custom themes. This is especially helpful when reviewing changes in Lazygit, as it makes it easier to spot what’s changed at a glance.

Installing delta

On Arch Linux (or derivatives), you can install delta with:

For other platforms, check thedelta installation instructions.

Configuring Lazygit to use delta

To use delta as the pager in Lazygit, add the following to your~/.config/lazygit/config.yml:

This tells Lazygit to use delta for displaying diffs, with color always enabled and paging disabled (since Lazygit handles paging itself).

Here are two screenshots with the diffs better highlighted:

Show line numbers

If you want to see line numbers in your diffs, update the pager line with “–line-numbers”.

Customizing delta with themes

Delta supports custom themes for even better readability. You can find a collection of themeshere.

To use these themes:

  1. Download the rawthemes.gitconfigfile, for example, to~/.config/delta/themes.gitconfig:

  2. Include it in your global Git config by adding the following to your~/.gitconfig:

  3. To see available themes, run:

  4. Pick a theme you like (e.g.,colibri) and enable it in your Lazygit config:

For example, with the “colibri” theme:

With “weeping-willow” theme:

Enjoy your diffs! 🙂

One thought on “Better diffs in Lazygit with delta”

Leave a Reply

This site uses Akismet to reduce spam.Learn how your comment data is processed.