Oyo
A diff viewer for stepping through changes and reviewing scrollable diffs.
https://github.com/user-attachments/assets/0f43b54b-69fe-4cf3-9221-a7749872342b
Oyo is a terminal diff viewer.
Use it as a normal scrollable diff viewer, or step through changes one at a time. You can switch between both modes at any time.
Choose a review mode
Scroll-only diff
Use scroll-only mode when you want a traditional diff viewer.
You can:
- review all changes at once
- scroll freely
- jump between hunks
Start with:
Step-through diff
Use step-through mode when you want to see how a file changes over time. This helps with large refactors and careful reviews.
Start with:
You can also press s in the TUI, or set stepping = true in config.
Features
- scroll-only diff mode
- step-through navigation
- hunk navigation
- unified, split, evolution, blame and preview views
- tabs for multiple views
- mouse support
- Markdown, JSON, YAML, TOML and CSV previews
- inline review comments
- visual text selection with copy, comments and command actions
- word-level diffing
- multi-file navigation
- watch mode that refreshes changed files on disk
- regex search
- syntax highlighting
- blame hints
- command palette
- line wrap
- context folding
- animated transitions
- autoplay
- Git integration
- commit picker with
oy view - built-in themes and
.tmThemesyntax themes - XDG config file support
Install
npm
Pi package
This gives you the /diff and /review commands.
Homebrew
Arch Linux
Cargo
Use Oyo
Show uncommitted changes
Step through uncommitted changes
Compare 2 files
Compare one file with HEAD
Show staged changes
Show a Git range
Choose a view mode
Use autoplay
Pick a commit range
Review comments
Add comments while reviewing. Oyo prints them when you quit.
Write comments to a file:
Write comments only to a file:
Disable persisted review sessions:
Start a fresh persisted review session:
Review hooks are documented in review hooks.
Use with Git
Use git difftool:
Add this to ~/.gitconfig:
Keep your pager, such as less, moar or moor, for git diff.
Do not set core.pager or interactive.diffFilter to oy.
Use with Jujutsu
Add this to your Jujutsu config:
[]
= "never"
= ["oy", "$left", "$right"]
[]
= ["oy", "$left", "$right"]
Keybindings
Most navigation commands support counts. For example, 10j moves 10 steps forward and 5J scrolls down 5 lines.
Common defaults:
| Key | Action |
|---|---|
j, down |
Scroll down, or next step in step mode |
k, up |
Scroll up, or previous step in step mode |
l, right |
Next hunk |
h, left |
Previous hunk |
v |
Start character selection |
V |
Start line selection |
ctrl-v |
Start block selection |
y |
Copy selection or current line |
/ |
Search |
n |
Next search match |
N |
Previous search match |
tab |
Cycle view mode |
s |
Toggle stepping |
m |
Add or update a line comment |
M |
Add or update a hunk comment |
ctrl-s |
Save an inline comment |
ctrl-p |
Open the command palette |
R |
Refresh files |
? |
Show help |
q, esc |
Quit |
Full keybinding and mouse reference: keybindings.
Selection works with mouse drag or v, V and ctrl-v. Press y to copy and esc to clear.
Clipboard support first uses system tools:
pbcopyon macOSwl-copy,xcliporxselon Linuxclipon Windows
If those fail, Oyo falls back to OSC 52 terminal clipboard support.
Configure Oyo
Create a config file at ~/.config/oyo/config.toml.
You can also pass extra config files with repeatable --config FILE. Oyo loads your user config first, then merges each extra config file in order.
Minimal config:
[]
= "unified"
= false
= true
= false
= "off"
[]
= "syntax"
= true
= "word"
[]
= "on"
[]
= true
= 30
= "left"
Config is loaded from the first matching file:
$XDG_CONFIG_HOME/oyo/config.toml~/.config/oyo/config.toml- the platform config directory, such as
~/Library/Application Support/oyo/config.tomlon macOS
Use these docs for full configuration:
- config reference
- theme configuration
- keybinding actions
- review hooks
- diff behaviour
- diff styling previews
Diff styling previews include screenshots.
Development