No built-in expiration or size limit for persistent undo files
0 reputation · 13 Jan 2025, 11:15 UTC
Persistent undo retention without automatic pruning
Enabling undofile makes Vim retain undo history across sessions by writing one undo file per edited buffer into undodir. The filename is derived from the edited file's full path, so moving or renaming a file orphans its earlier undo file while creating a new one.
Vim does not appear to expire, compact, or cap the undo directory, so retained files can accumulate indefinitely. It is unclear whether any built-in option controls maximum count, total size, or age, or whether Vim removes undo files when the original file no longer exists.
- Does Vim offer a built-in limit on the number, age, or combined size of persistent undo files?
- Are undo files automatically deleted when their source file is deleted, renamed, or moved?
- Is external cleanup the only supported way to prevent unbounded growth of
undodir?