Comment

Comment by justinmk

Vim undofile "data loss" happens because Vim (VIM!) will reset the undofile will reset the undofile if an external tool (git, nano) changed the file while Vim is not running.

Go ahead, try it:

    # Make some edits, then exit vim (remember to exit).
    vim --clean +'set undofile' foo.txt

    # Edit the same file with non-vim; save the changes.
    nano foo.txt

    # Open the file again and try "u". Then post on bluesky about Vim's "duty of care".
    vim --clean +'set undofile' foo.txt

This is documented at `:help undo-persistence`.
parent justinmk 1 month ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton