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.
Use scroll-only mode when you want a traditional diff viewer.
You can:
Start with:
oy
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:
oy --step
You can also press s in the TUI, or set stepping = true in config.
oy view.tmTheme syntax themesnpm i -g @ahkohd/oyo
This gives you the /diff and /review commands.
pi install npm:@ahkohd/pi-oyo
brew install ahkohd/oyo/oy
paru -S oyo
cargo install oyo --locked --force
oy
oy --step
oy old.rs new.rs
oy path/to/file.rs
oy --staged
oy --range HEAD~1..HEAD
oy --range main...feature
oy old.rs new.rs --view split
oy old.rs new.rs --step --view evolution
oy old.rs new.rs --step --autoplay
oy old.rs new.rs --step --speed 100
oy view
Add comments while reviewing. Oyo prints them when you quit.
oy
Write comments to a file:
oy --review-output-file /tmp/oy-review.txt
Write comments only to a file:
oy --review-output-file /tmp/oy-review.txt --no-print-review
Disable persisted review sessions:
oy --no-review-persist
Start a fresh persisted review session:
oy --clear-review-session
Review hooks are documented in review hooks.
Use git difftool:
git difftool -y --tool=oy
Add this to ~/.gitconfig:
[difftool "oy"]
cmd = oy "$LOCAL" "$REMOTE"
[difftool]
prompt = false
[alias]
d = difftool -y --tool=oy
Keep your pager, such as less, moar or moor, for git diff.
Do not set core.pager or interactive.diffFilter to oy.
Add this to your Jujutsu config:
[ui]
paginate = "never"
diff-formatter = ["oy", "$left", "$right"]
[diff-tools.oy]
command = ["oy", "$left", "$right"]
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:
pbcopy on macOSwl-copy, xclip or xsel on Linuxclip on WindowsIf those fail, Oyo falls back to OSC 52 terminal clipboard support.
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.
oy --config /tmp/oyo-plugin.toml
Minimal config:
[ui]
view_mode = "unified"
stepping = false
watch = true
line_wrap = false
fold_context = "off"
[ui.diff]
fg = "syntax"
bg = true
highlight = "word"
[ui.syntax]
mode = "on"
[files]
panel_visible = true
panel_width = 30
panel_position = "left"
Config is loaded from the first matching file:
$XDG_CONFIG_HOME/oyo/config.toml~/.config/oyo/config.toml~/Library/Application Support/oyo/config.toml on macOSUse these docs for full configuration:
Diff styling previews include screenshots.
cargo build
cargo test
cargo run --bin oy -- old.rs new.rs