DiffT
Compare a Git branch or two folders with native difftastic hunks in webview tabs.
DiffT is not VS Code’s built-in side-by-side editor (vscode.diff) and it is not git diff. The highlights you see are the structural hunks difft computed.
Requirements
Install difft so it is on your PATH. If the binary lives somewhere else, set DiffT: Path (difft.path) to that file.
How to use
Open a folder in VS Code or Cursor.
Click the DiffT icon in the activity bar. The Compare tree lists changed files (folders, added / modified / deleted).
Use the actions on the Compare view:
- Compare with master — current branch vs
master (falls back to main if master is missing). Default is a three-dot / merge-base compare.
- Compare with branch... — pick another branch or ref as the base. Picking the current branch compares the working tree (staged, unstaged, and untracked files) to HEAD.
- Compare directories... — pick an old folder, then a new folder.
- Configure (gear) — current values are marked with ✓. Context shows how many unchanged lines sit around each hunk; pick that row to change the number.
Click a file in the tree to open it in a DiffT tab. Clicking a file that is already open brings that tab forward without running DiffT again.
The same commands are in the Command Palette under DiffT.
Display
Pick a layout from the gear menu or Settings:
- side-by-side (default) — two columns; an exclusive add or remove hides the empty side.
- side-by-side-show-both — the same two-column grid, but a changed line always shows both sides.
- inline — one column, old then new.
Changing display, context, or other DiffT settings rebuilds the open tabs in place.
Keyboard
When the DiffT tab is focused:
| Key |
What it does |
| Up / Down |
Previous / next changed line |
| Page Up / Page Down |
Previous / next hunk |
| Alt+F5 / Shift+Alt+F5 |
Next / previous hunk |
Mouse
- Click a line, or use the arrow keys, to highlight it.
- Double-click a side to open that file in a normal editor at that line. Left is the old / base version; right is the current / workspace file.
Settings
All of these are under DiffT in Settings.
difft.path — Command or full path for the difft binary. Default: difft on your PATH.
difft.background — Dark or light page, inserted/removed, and syntax colors. When this does not match the workbench, DiffT uses your preferred light or dark color theme so the compare view actually changes.
difft.syntaxHighlight — Syntax highlighting in the compare view, using the editor's own TextMate grammars, color theme, and editor.tokenColorCustomizations (context lines included). Falls back to difftastic's coarse token kinds for languages without a grammar.
difft.parseErrorLimit — How many parse errors difftastic allows before it gives up (0 is difftastic’s default).
difft.ignoreComments — Treat comment-only changes as unchanged.
difft.skipUnchanged — Hide unchanged files in the Compare tree.
difft.ignore — Glob patterns to omit from the tree (default includes **/.DS_Store). A workspace .difftignore is also read, one pattern per line.
difft.defaultBaseBranch — Branch Compare with master uses. Default master; DiffT falls back to main when that branch is missing.
difft.compareMode — three-dot (merge-base) or two-dot (tip-to-tip).
difft.display — Viewer layout: side-by-side, side-by-side-show-both, or inline.
difft.context — Unchanged lines shown around each hunk. 0 means hunk lines only.
Development
Clone this repo. Use Node 22. Then npm test, or make to install dependencies and build a VSIX in out/.