lziff
A cross-platform terminal diff & review tool with JetBrains-style snap-aligned side-by-side diffs.
Demo Screenshot
| File diff | Screenshot |
|---|---|
| View Diff | ![]() |
| Review Mode | Screenshot |
|---|---|
| Select PR | ![]() |
| PR diff | ![]() |
| Review / Comment | ![]() |
| Submit Review | ![]() |
What it does
- Side-by-side diff of two files or any pair of git states.
- Snap alignment: click any line and the other pane scrolls until
the corresponding line lands on the same row. Equal anchors stay
visually connected by
●─●ribbons in the gutter. - No filler rows: each pane shows its file as-is. When one side has more change than the other, scrolling automatically pauses the shorter side at change-block boundaries so the panes re-sync at the next equal anchor.
- Word-level highlights inside modified lines, with a similarity threshold so unrelated pair-ups don't turn into red/green noise.
- Auto-reload while you edit — saves outside the tool show up within a couple hundred milliseconds.
- Mouse + keyboard: click to snap, wheel to scroll the pane under the pointer, vim-style keys for everything else.
Install
Homebrew (macOS / Linux)
cargo (crates.io)
From source (Rust 1.74+)
Pre-built binaries
Download the latest binary for your platform from the
Releases page
and put it somewhere on your $PATH.
Usage
Git workflows
Run lziff anywhere inside a git repository and it picks up the repo
automatically. The Files panel on the left lists every changed file;
pick one with j/k (or click), then explore the diff on the right.
Arbitrary file pair
The Files panel hides itself in this mode so the diff fills the screen.
Live editing loop
Run lziff in one terminal and edit in another — saves are picked up
automatically and the diff redraws in place. Useful when you want to
review your in-progress changes without alt-tabbing through git diff.
Keys
| Key | Action |
|---|---|
j / k |
scroll both panes 1:1 |
J / K |
jump to next / previous change hunk |
Ctrl-d/u |
half-page down / up |
g / G |
top / bottom |
n / p |
next / previous file |
click |
select that line; the other pane snaps to it |
wheel |
scroll the pane under the pointer |
= |
re-snap the non-anchor pane to the cursor row |
Tab |
toggle focus (Files / Diff) |
F |
show / hide the Files panel |
r |
manual reload |
? |
open this help |
q |
quit |
Configuration
lziff reads $XDG_CONFIG_HOME/lziff/config.toml (or the platform
equivalent — e.g. ~/Library/Application Support/lziff/config.toml
on macOS). The file is optional; missing keys fall back to sensible
defaults.
[]
= "ja" # "en" or "ja" — defaults to $LANG
[]
= 20 # % of horizontal space for the Files list
= 5 # 5-char gutter between the two diff panes
= 3 # alignment row sits at viewport_h / N
[]
= 250 # auto-reload poll interval
= 3 # mouse-wheel step
= 15 # ctrl-d / ctrl-u step
= 0.30 # below this, paired lines drop word-diff
# Rebind any of the 19 actions. Override accepts a single string or an
# array. Modifiers: ctrl-, shift-, alt-. Named keys: Up, Down, Left,
# Right, Enter, Esc, Tab, F1..F12, PageUp, PageDown.
[]
= ["q", "Esc"]
= ["j", "Down"]
= ["k", "Up"]
= "J"
= "K"
= "ctrl-d"
= "ctrl-u"
= "?"
= "F"
= "="
# Every visual color is themable via #rrggbb. Below is just a sample;
# all theme keys are documented in the config module.
[]
= "#301618"
= "#142c1a"
= "#963c46"
= "#328246"
= "#f5f5fa"
= "#e1c882"
Status
Early days — the diff engine and snap UX are stable, but the plugin boundary (for hosting non-git sources) is still in design. Issues and suggestions welcome on the issue tracker.




