Undo/redo tracked per line, per file, instead of VS Code's single global undo tree.
Type in one line, jump to another line and type there, then come back and press
Line Undo: it undoes only that line's last change, not whatever you typed elsewhere
in between.
Commands
Line Undo/Redo: Undo Current Line (Ctrl+Alt+Z / Cmd+Alt+Z): reverts the
line the cursor is on to its previous content.
Line Undo/Redo: Redo Current Line (Ctrl+Alt+Y / Cmd+Alt+Y): reapplies a
change that was just line-undone.
VS Code's normal Ctrl+Z / Ctrl+Y still work as before and are untouched.
How it works
The extension keeps a small undo/redo stack per line number per open document.
Consecutive keystrokes on the same line within ~800ms are coalesced into one
undo step (like normal typing feels in VS Code), so you don't have to press
undo once per character.
Limitations
Edits that span multiple lines (pasting a multi-line block, deleting a
selection that crosses lines, pressing Enter) reset the per-line history for
that file, since line numbers shift and old per-line snapshots would no
longer line up correctly. Plain single-line typing/backspacing is fully
tracked.
History is in-memory only and is lost when a file is closed or VS Code
restarts.
Running it
Open this folder in VS Code.
Press F5 to launch an Extension Development Host with the extension loaded.
Edit some lines, jump around, and try the two commands from the Command
Palette or their keybindings.
Packaging
npm install -g @vscode/vsce
vsce package
This produces a .vsix you can install via Extensions: Install from VSIX....