Undotree is a Vim plugin that reveals Vim's non-linear undo history as a navigable tree, letting users visualize and revisit past versions or divergent edit branches. It modifies the current buffer temporarily without saving to disk, ensuring safety during navigation. Vim's undo/redo feature is a great way to protect your work from accidental changes or data loss. Unlike other editors, where undoing and then accidentally typing something can cause you to lose your edits, Vim allows you to revert to previous states without losing any data, as long as you keep the Vim session alive. If you want to keep your undo history permanently, Vim offers a persistent undo feature. This feature saves your undo history to a file on disk, allowing you to preserve your undo history across editing sessions. To enable persistent undo, refer to the instructions below. This can be a useful option for those who want to maintain a long-term undo history for a file or project.
Features
- Visualizes undo history as a tree with branch navigation
- Allows switching between branches without altering file contents or disk writes
- Displays markers, timestamps, and the current/next state for clarity
- Works with Vim’s persistent undo feature for long-term edit history retention
- Lightweight implementation in pure Vimscript requiring no external dependencies
- Licensed under BSD‑3‑Clause for permissive use and integration