Inline Git Diff (GitHub style)
Paints the git changes inside the code you are editing:
- new or modified lines get GitHub's green background;
- deleted lines are drawn as red rows, with their real indentation, exactly where they were.
Colors
Default colors: #2ea04326 / #f851491a (dark) and #e6ffec / #ffebe9 (light). Two ways to change them:
In the settings (inlineGitDiff.addedColor and inlineGitDiff.removedColor), any CSS color is accepted:
"inlineGitDiff.addedColor": "#0f02",
"inlineGitDiff.removedColor": "rgba(255,0,0,0.18)"
Or per theme, keeping the values empty in the settings:
"workbench.colorCustomizations": {
"inlineGitDiff.addedLineBackground": "#2ea04326",
"inlineGitDiff.removedLineBackground": "#f851491a"
}
Compatible editors
The green lines are ordinary decorations and work everywhere. The red rows are drawn with the
editorInsets proposed API, which only some editors expose — so the extension ships in two builds:
| Editor |
Build to install |
Green lines |
Red rows |
| Antigravity IDE |
inline-git-diff-antigravity |
yes |
yes |
| VS Code (stable) |
inline-git-diff |
yes |
no |
| Other forks (Cursor, VSCodium, Windsurf, …) |
start with inline-git-diff |
yes |
only if the fork ships editorInsets |
The VS Code build declares no proposed API, so it activates normally there. The Antigravity build
declares editorInsets and enables itself in that editor's argv.json (see below). If you install the
Antigravity build on an editor without the proposal, the extension will not start; use the VS Code build
in that case.
Install
# Antigravity
antigravity-ide --install-extension inline-git-diff-antigravity-0.2.0.vsix
# VS Code
code --install-extension inline-git-diff-0.2.0.vsix
Settings
| Setting |
Default |
What it does |
inlineGitDiff.enabled |
true |
Turn it on / off |
inlineGitDiff.base |
head |
head (last commit), index (staged) or upstream (everything not pushed yet) |
inlineGitDiff.maxLines |
20000 |
Larger files are skipped |
inlineGitDiff.addedColor |
(empty) |
Color of the added lines; empty = the theme's inlineGitDiff.addedLineBackground |
inlineGitDiff.removedColor |
(empty) |
Color of the red rows; empty = the theme's inlineGitDiff.removedLineBackground |
The red rows need a restart (Antigravity build)
The rows are drawn with the editorInsets proposed API, which the editor only grants to the extensions
listed in its argv.json. The extension adds itself there the first time it starts and tells you; you have
to close the whole editor and open it again (Reload Window is not enough). Until then only the green
lines show up.
Manual command, if you ever need it: Inline Git Diff: Enable Inline Rows (restart required).
Privacy and security
- Nothing leaves the machine. No telemetry, no analytics, no network requests at all.
- The only process it runs is
git (rev-parse, show), through execFileSync — never a shell, and only
inside the open file's repository.
- The red rows live in a webview with
enableScripts: false and a default-src 'none' CSP; the deleted
lines are HTML-escaped before they are shown.
- It declares
untrustedWorkspaces.supported: true (it only reads a file's git base, it never executes
the project) and virtualWorkspaces: false (there is no local filesystem there to ask git about).
Development
node --test test/*.test.js # line diff + color guard, no editor needed
node build.js # both builds -> dist/vscode, dist/antigravity
node build.js antigravity # just one of them
build.js copies the sources, patches package.json (name, display name, enabledApiProposals) and
writes src/variant.js, which is all that differs between the two builds.
License
MIT — see LICENSE.