UndoTree
The undo history visualizer for Sublime Text
Details
Installs
- Total 29
- Win 15
- Mac 6
- Linux 8
| Apr 3 | Apr 2 | Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | Mar 24 | Mar 23 | Mar 22 | Mar 21 | Mar 20 | Mar 19 | Mar 18 | Mar 17 | Mar 16 | Mar 15 | Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | Mar 4 | Mar 3 | Mar 2 | Mar 1 | Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
| Mac | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
Readme
- Source
- raw.githubusercontent.com
UndoTree for Sublime Text
A Vim-style UndoTree plugin for Sublime Text 4 (Python 3.8+), visualizing undo history as a branching ASCII tree with live diff previews.
Features
- Branching undo history — every save creates a new node; multiple branches supported
- ASCII tree visualization — shows the hierarchy of undo states using indentation and
- - Current node marker — the active undo state is marked with
* - Sequential counters — each node is numbered for easier reference (
1 -> +2 -0) - Live diff preview — highlights changes when navigating the tree
- Restore any state — select a node to restore its content in the editor
- Automatic initial snapshot — captures file content on open
- Lightweight & Python-only — no external dependencies
Installation
- Place the plugin folder into your Sublime Text
Packagesdirectory:
- Linux:
~/.config/sublime-text/Packages/ - Windows:
%APPDATA%\Sublime Text\Packages\ - macOS:
~/Library/Application Support/Sublime Text/Packages/
- Restart Sublime Text.
Usage
Open UndoTree
- Open the command palette (
Ctrl+Shift+P/Cmd+Shift+P) → Show UndoTree - The tree will appear in a Quick Panel, for example:
*1 -> Initial state
2 -> +2 -0
3 -> +1 -0
4 -> +3 -1
5 -> +1 -2
*marks the current node->separates the counter from the diff summary
Restore a Node
- Move the selection in the Quick Panel
- Press Enter → restores the editor content to that node
- Hovering over nodes shows a live diff preview in a separate panel
UndoTree Behavior
- Every file save creates a new node
- Branches are automatically tracked if you modify the file from an older state
- Initial file load automatically captures the starting state
Example Tree
*1 -> Initial state
2 -> +2 -0
3 -> +1 -0
4 -> +3 -1
5 -> +1 -2
- Shows indentation for branches
- Current node is marked with
* - Numbers help track node order
Commands
| Command | Description |
|---|---|
show_undo_tree |
Opens the UndoTree Quick Panel |
undo_tree_restore |
Restore buffer content to a specific node |
undotree_write_preview |
Internal: writes live diff preview |
undotree_write_panel |
Internal: updates ASCII tree panel |
Requirements
- Sublime Text 4 / 3.8+
- Python 3.8+ (built-in with Sublime Text 4)
- No additional dependencies
Notes
- ASCII tree uses spaces and
-only for branch visualization, so it works in any font - Hover preview works with the diff panel
- Branches can be navigated visually, but the Quick Panel does not allow full Vim-style j/k navigation yet