gap: UI text diff
Summary
gap is a simple GUI text diff utility for comparing files and directories, supporting Myers diff algorithm, inner-diff views, git integration, and customizable settings. It is a self-contained tool with no external dependencies beyond a C++ compiler.
View Cached Full Text
Cached at: 07/12/26, 10:49 AM
cdacamar/gap
Source: https://github.com/cdacamar/gap

gap - GUI Text Diff.
gap
This is a very simple text GUI diffing utility started during the Handmade Essentials 2026 Jam.
The goal of gap is to provide a very simple native utility which presents diffs in a way that you might see them on popular source control sites such as Github or Azure DevOps.
The secondary goal of gap is to serve as a proof-of-concept for implementing the linear variant of the Myers diff algorithm for use in fred.
Features
- Self-contained repo. There are no dependencies outside of a C++ compiler (some Linux caveats).
- Multiple options for viewing inner-diffs within similar blocks (word-based and character-based).
- Easily swap the order of diffs with a single button.
- Expand/collapse context window at the push of a button (anything below 0 indicates ‘infinite’ context, implying there is no window).
- Supports directory diffing where each file in the corresponding directory is matched to files in the opposite directory.
- Full configuration explorer just like in fred from which you can change settings such as viewing line numbers, changing colors, or disabling animations.
- Help panel which provides hotkey rebinding.
- Multiple renderer options on Windows (DX11 and OpenGL with DX11 being default).
- Supports subpixel font rendering (on by default).
- Supports both Windows and Linux (no OSX).
Usage
$ gap a.txt b.txt # file diffing.
$ gap .\A .\B # directory diffing.
Or simply open gap and drag-and-drop files onto each panel side for diffing. You can overwrite a file by dragging and dropping a new file onto that panel. You can also open the directory diffing panel via the default of CTRL+O and drag directories onto each side for a directory comparison.
Another way of using gap is to tie it into git for viewing local diffs:
$ git config difftool.gap.path "D:/git_projects/gap/build/gap.exe"
$ git config difftool.gap.cmd "D:/git_projects/gap/build/gap.exe """$LOCAL""" """$REMOTE""""
$ git config diff.tool gap
Which you can then use git difftool instead of git diff to view diffs locally.
Additionally, you may want to consider invoking git difftool as git difftool -d to take advantage of the directory diffing in gap.
On Linux you would simply escape the quotes differently and alter paths.
Screenshots

Building
Windows:
- Open up an VS2022 (or later) x64 Developer Command Prompt
$ build
Or for release:
$ build release
Linux:
- Ensure you have a recent-ish version of gcc. I used 13.3.0.
- Have the following system dependencies installed:
- OpenGL (I used libglx-dev)
- X11 (I used libx11-dev)
- X11-ext (I used libxext-dev)
- Xrandr (I used libxrandr-dev)
$ ./build.sh
Or for release:
$ ./build.sh release
License
MIT
Similar Articles
@geekbb: A diff tool that the author boldly calls "the best diff viewer ever". If you often read code changes or review patches, its goal is to make diff results more intuitive and visually appealing. https://github.com/rockorager/comview…
Introduces a terminal diff tool called comview, which the author claims is "the best diff viewer ever". It supports reading unified diff from stdin and renders it beautifully, suitable for code review.
@sashimikun_void: https://github.com/nkzw-tech/codiff… Cool code diff viewer btw...
Codiff is a beautiful, local diff viewer for Git repositories with LLM-powered walkthroughs and inline review comments, designed to streamline code review before committing.
DiffsHub
DiffsHub is a tool that provides a fast, virtualized interface for viewing any public GitHub diff (PRs, commits, etc.) by simply replacing github.com with diffshub.com in the URL.
Show HN: Codiff, a local diff review tool
Codiff is a minimal, local diff viewer for reviewing staged and unstaged Git changes, with LLM-powered walkthroughs and inline review comments.
@mitchellh: Hunk is very good. It has completely replaced any other local diff viewer for me. It looks good, its speedy, good keybo…
Hunk is a review-first terminal diff viewer for agent-authored changesets, offering features like multi-file review streams, inline AI annotations, and Git/Jujutsu support.