// HACKER NEWS — CYBERSECURITY
Installing NeoVim caused original Vim undo files to be deleted
A Mastodon post by computer scientist David Chisnall has a very Unsung opener:
I have used vim since around 2000. I have written five books, a PhD thesis, a few dozen papers and over 150 articles with it. At this point, my higher brain functions are not engaged at all when I use a bunch of common vim commands, they just happen. Documents I wrote with anything else have random :w in the middle.
Chisnall goes on to talk about one specific vim feature:
Persistent undo is one of my favourite features of vim. […]
I don’t often need the persistent undo. But on the few occasions when I have needed it, it’s been invaluable: ooops, I deleted something from this file, maybe last week and one reboot ago, what was it? Undo until I find it, copy it, paste it into the current version. Or, a bit more commonly: I had this working, then I tidied it up ready to commit, now it isn’t working, what did I do?
Vim has kept this working across major version upgrades over a period of about 20 years. I don’t even think about it, it’s just part of Raskin’s First Law: A program may not harm a user’s data or, through inaction, allow a user’s data to come to harm. If vim or the computer crash, or if I close a file and come back to it six months later, my undo history is still there.
NeoVim is a fork of vim (in news for other reasons):
So I tried NeoVim when it was quite new. Vim that you are familiar with, but better? Great!
The first thing I noticed in NeoVim was that undo didn’t work. I tried opening the file in vim and undo didn’t work there either.
Neovim had changed the format of the undo files. It hadn’t upgraded the old one. It hadn’t used a different name for its undo files. It had just noticed the existence of a vim undo file, deleted it (losing all of the data in it) and replaced it with one that vim couldn’t read.