← Back to context

Comment by fooblaster

8 hours ago

How does one use persistent undo in vim?

Talk about poor duty of care to users... been using him for 20 years and I have to enable it in my vimrc to take effect. So stupid. Why would I want this to be off?

Such amazing design...

" Enable persistent undo set undofile

  • It’s somewhat important for privacy reasons that the feature is opt-in. I don’t know if that’s the reason historically, but I wouldn’t want a text editor to persistently store a copy of everything I type without my consent. It’s almost like a keylogger.

    Making privacy-sensitive features opt-in is a form of duty of care as well, to avert harm from the user.

    • Edit history in JetBrains being on by default saved my bacon a few times over the years.

  • I prefer persistent undo being off. I like being able to hold down u and revert to exactly how the file was before I opened it. (Maybe there's a better way to do this?) With persistent undo on, it just keeps going and going. And if I need long term source control, that's what git is for. With persistent undo off, it's like opening the file creates a checkpoint that I can get back to easily.

  • Emacs and Vim are basically like that.

    They have very vocal and entrenched users so that practically no defaults can be changed lest the single Amiga user will start a huge uproar.

    And since they don't really have a BDFL or commercial pressure, they can be super detached even from standards or expectations that appeared 40 years ago.

    Neovim was basically a reaction to that, for Vim, where they updated defaults to stuff basically every Unix editor since 2005 has.