Skim
A keyboard-driven TUI for code reviews built in Zig.
Features
- Vim-style modal interface (hjkl, Ctrl-n/p navigation)
- File-by-file diff navigation
- Unified and side-by-side views
- Hunk view modes: show all lines, only additions, or only deletions
- Tree-sitter syntax highlighting with async processing (JS/TS/Zig full support)
- Command palette:
Ctrl-p for files, : for commands (vim-style), or type > to switch modes
- Built-in help with
?
- Search with
/ across all files
- Visual selection mode for multi-line operations
- Character find commands (
f/t/F/T like vim)
- Live refresh (press 'r')
- Full git diff compatibility (working dir, staged, branch comparisons)
- Comment system with export to clipboard ('y' for current, 'Y' for all)
- Editor integration (Ctrl-g opens file at line in $EDITOR)
- Git blame display toggle
- File staging from within the TUI
- Graphite stack integration (navigate stacked PRs)
- AI agent panel with
@file fuzzy search for embedding file contents
Installation
Building from Source
Prerequisites
git clone https://github.com/ctdio/skim.git
cd skim
# Debug build (for development)
zig build
# OR release build (optimized)
zig build -Doptimize=ReleaseFast
The binary will be available at ./zig-out/bin/skim.
Development Checks
# Run the test suite
zig build test
# Run repo-configured ziglint checks
zig build lint
zig build lint uses the repo's .ziglint.zon. The wrapper script
prefers a locally installed ziglint binary and otherwise falls back to
mise x github:rockorager/[email protected] -- ziglint.
Quick Start
# Build and run
zig build
./zig-out/bin/skim
# Review your changes
./zig-out/bin/skim --staged
Navigate with j/k, switch files with h/l. Press Enter to focus a file. Press s to toggle unified/side-by-side views. Press Ctrl-e to open the agent panel.
Usage
Skim follows git diff conventions for specifying what to review:
# Review working directory changes
skim
# Review staged changes
skim --staged
# Working directory vs. specific branch
skim main
# Staged changes vs. specific branch
skim --staged main
# Compare two branches (two ways)
skim main feature
skim main..feature
# Compare commits
skim abc123..def456
# Merge-base comparison (changes on feature since diverging from main)
skim main...feature
# Working directory vs. 5 commits ago
skim HEAD~5
As a Git Pager
Skim can read diffs from stdin, making it usable as a git pager. Add to your ~/.gitconfig:
[pager]
diff = skim diff
show = skim diff
log = skim diff
Or set via command line:
git config --global pager.diff "skim diff"
git config --global pager.show "skim diff"
git config --global pager.log "skim diff"
You can also pipe diffs directly:
git diff | skim diff
git show HEAD | skim diff
cat some.patch | skim diff
Keybindings
NORMAL Mode (Default)
Navigate files and position cursor with vim-style movements:
Navigation
| Key | Action |
|---|
h / l | Previous / Next file |
j / k | Cursor down / up |
Ctrl-n | Next file (alternative) |
Ctrl-d / Ctrl-u | Page down / up |
gg | Jump to top of file |
G | Jump to bottom of file |
Shift-M | Center cursor in viewport |
zz | Center viewport on cursor |
[h / ]h | Previous / Next code change (supports count prefix) |
[c / ]c | Previous / Next comment |
{ / } | Previous / Next empty line (supports count prefix) |
Character Find (like vim)
| Key | Action |
|---|
f{char} | Find character forward (cursor on character) |
F{char} | Find character backward (cursor on character) |
t{char} | Find character forward (cursor before character) |
T{char} | Find character backward (cursor after character) |
; | Repeat last find in same direction |
Search & Command Palette
| Key | Action |
|---|
/ | Enter search mode |
n / N | Next / Previous search match |
Ctrl-p | Open file palette (type > to switch to commands) |
: | Open command palette (vim-style) |
? | Show keybindings help |
Comments
| Key | Action |
|---|
Enter | Add/edit comment on cursor line |
d | Delete comment under cursor |
D | Clear all comments |
o | Toggle comment expand/collapse |
y | Yank (copy) current comment to clipboard |
Y | Yank (copy) all comments to clipboard |
gY | Yank all comments to agent input |
View Modes
| Key | Action |
|---|
s | Toggle unified/side-by-side view |
Tab / Shift-Tab | Cycle hunk view mode (all / additions only / deletions only) |
B | Toggle git blame in gutter |
Folding