Dazzling Diffs


I’m not sure how long these alliterative titles are going to work.

Happy Friday!

If you are a regular user of git, you’ll know that the default git diff experience leaves much to be desired. It gets the job done, and it works everywhere, so I can’t really fault it. But we can do better.

​delta is a plug-and-play tool that instantly makes your git diffs easier to work with. It belongs to the category of tools like bat and exa that take some integral part of your workflows and just adds nice quality of life features to it without requiring you to change how you operate.

Setup

You’ll need to install the package however you prefer https://dandavison.github.io/delta/installation.html.

Then add this to your ~/.gitconfig:

[core]
    pager = delta
[interactive]
    diffFilter = delta --color-only
[delta]
    navigate = true
    dark = true
[merge]
    conflictStyle = zdiff3

That is all you need for the basic setup. With that in place, whenever you do git diff, git log -p, git show, and work through merge conflicts, the diff visualization will always flow through delta.

There is another flag I think is worth turning on.

[delta]
    side-by-side = true

I prefer seeing the side-by-side rather than intermixed in the same block. It makes it a lot easier to actually compare large changes.

Quick tidbits

You can use n and N to jump forwards and backwards between files in the pager.

You can still use all of the normal pager behavior like / to search.

You can use delta as a plain diff viewer between any two files with delta .

Wrapping it up

Delta is one of those tools where once it is setup, it subtly makes your life just a little bit easier. And over time you get used to it and forget that it isn’t part of the normal behavior. And then when you inevitably end up on a machine without it, you realize how much you want it.

If you’re regularly working with git, it is worth giving a try.

– Logan / Terminal Velocity

Terminal Velocity

Automation should feel like cheating. Join me for fast, practical tips that turn your terminal into a superpower.

Read more from Terminal Velocity

Happy Friday! Recently I’ve been encountering a frustrating scenario where my coding agents get a bit too enthusiastic and write some integration test logic that ends up in an infinite loop, consuming all of my system resources, crashing my desktop, and ultimately freezing the machine. Ahh, technology! I looked to my toolkit to see what the simplest way to prevent this would be, without having to overly complicate my setup. I knew systemd has a bunch of isolation utilities, so I figured it...

Happy Friday! I don’t know about you, but I’m always on the lookout for more services to try out in my home lab. I regularly check out https://github.com/awesome-selfhosted/awesome-selfhosted and https://www.reddit.com/r/selfhosted/ to see what looks interesting. This past week I was wanting to host something similar to Airtable and found that there were a few decent looking options including Baserow, Grist, and NocoDB. Being a lazy man, the natural question came up: How can I try each of...

Happy Friday! If you’ve seen my Shell Wizardry video, you’ll know I love fzf. But in my excitement to try to use it in as many clever places as possible, I failed to notice the even more useful piece which is the shell integration. Simply add one line to the end of your shell config file and the magic begins (start a new shell to see the effects). # bash eval "$(fzf --bash)" # zsh source <(fzf --zsh) # fish fzf --fish | source Inserting files/directories into commands (ctrl+t) Whenever you’re...