pro Pro tools
Git diff for markdown — see what changed without leaving the reader
Press Ctrl+Shift+D. A side panel opens showing the unified diff for the current file — uncommitted changes against HEAD, with syntax-coloured +/− rows.
Review it — git-diff overlaySee what changed, where it changed. In place.
What it does
Press Ctrl+Shift+D (or pick View → Toggle Git Diff) on any markdown file in a git repo. A side panel slides in showing the unified diff between the file on disk and HEAD — added lines on green rows, removed lines on red rows, hunks and metadata syntax-coloured the way they look in your terminal. Press Ctrl+Shift+D again to dismiss it.
The panel is a raw git diff output, not a styled overlay on the rendered markdown. That distinction matters: if you want to see “the document with diff context,” this isn’t that — what you get is the actual diff a reviewer would see, formatted for reading instead of monospace terminal output.
Why it exists
The standard “what did I change” workflow has three steps: alt-tab to terminal, run git diff foo.md, parse colored monospace output. For markdown work that’s friction — your reader is right there, the file is open, the diff is sitting right next to it on disk. The git diff panel collapses that loop into one keystroke.
It’s especially useful when you’re iterating with an AI agent. The agent edits plan.md, you press Ctrl+Shift+D, you see exactly what changed in this round, decide whether to keep it or revert. Same with quick edits before you commit — toggle, scan, fix, commit, all without leaving the reader window.
How to use it
Toggle with Ctrl+Shift+D. The panel shows the diff for whatever document is currently open. There’s no per-document or per-window setting to remember — the panel state is in-memory for the current session, so opening a different file reuses the toggle but recomputes the diff for that file.
If the file is in a git repo and has uncommitted changes, you see the diff. If the file is in a repo with no uncommitted changes, the panel shows “no changes”. If the file isn’t in a repo at all, the toggle is a no-op.
Under the hood
The overlay shells out to git diff --no-color HEAD -- <relative-path> from the file’s repository root, with a fallback to git diff --cached HEAD -- <relative-path> when the working tree is clean (lets you see staged-but-not-committed changes too). The output is parsed into header / hunk / context / add / remove rows and rendered into a fixed-position panel as a styled <pre> block — no DOM mutation of the rendered document, no re-render trigger.
Re-runs are tied to MD View’s render lifecycle: every time the document re-renders (because of a file change picked up by the watcher, or a manual reload), if the diff panel is open, the diff re-runs and the panel updates. So live reload + git diff cooperate naturally — you can edit in another tool and watch both the rendering and the diff update in lockstep.
Use cases
- Pre-commit review for any markdown file you’re editing — toggle on, scroll the diff, fix anything that looks wrong, commit.
- “What did I change today” — open a doc, toggle, see the diff for everything since
HEAD. - Review during AI iteration — your agent edits
plan.md, you toggle, see exactly what was added or removed in this round, accept or revert. - Spot-checking a teammate’s work — pull their branch, open the file they touched, toggle the diff to see the change inline rather than in a separate
gh pr viewwindow.
Frequently asked questions
- Does it work without git?
- No. The overlay shells out to `git diff` for the current file. If the file isn't in a git repository, the toggle returns no result and the panel stays closed.
- What about untracked files?
- Untracked files (never committed, never staged) return no diff today. The overlay diffs against `HEAD`, with a fallback to the staging index — there's nothing to compare a brand-new file against.
- Does it slow down rendering?
- No. The overlay is a separate panel rendered into its own DOM, not an inline mutation of the document. Toggling on shells `git diff` once and renders a `<pre>` of the output; toggling off hides the panel.
- Does it auto-refresh when the file changes?
- Yes. The diff re-runs after each re-render, so live-reload + git-diff together give you a continuously up-to-date view of what's currently uncommitted as you edit in another tool.
MD View — free, lifetime $24
14-day Pro trial. Then keep every Free feature forever.