Stop formatting entire files. Only format the lines you actually changed.
This extension uses Git to detect your modifications and applies your VS Code formatter
only to those lines. The rest of the file stays untouched — clean diffs, clean history.
Ideal for working with Copilot, Cursor, or any AI tool that generates unformatted code.
Note: Currently optimized for Java. Other languages with a VS Code formatter may work but have not been fully tested.
✨ Features
Git-powered — detects changed lines via git diff HEAD.
Multi-file — formats all modified files at once.
Statement-aware — if you touched one line of a multi-line if() or method call, the whole statement gets formatted.
Smart reformat — joins broken statements into one line, then lets the formatter decide the correct layout.
Any language — works with Java, TypeScript, Python, C#, or any language with a VS Code formatter.
New files — untracked files are fully formatted.
🚀 Quick Start
Write or edit code (manually or with AI).
Press Ctrl+Alt+S.
Done. Files are formatted and saved.
📦 Requirements
Git installed and in PATH.
A Git repository with at least one commit.
A formatter extension for your language (Prettier, Java formatter, etc.).
⌨️ Keybinding
Command
Shortcut
Format Changed Lines
Ctrl+Alt+A
Customizable in File > Preferences > Keyboard Shortcuts.