ZH version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
57% Positive
Analyzed from 5882 words in the discussion.
Trending Topics
#vim#undo#neovim#software#data#don#file#duty#persistent#care

Discussion (236 Comments)Read Original on HackerNews
1. The change would break undo history, for both Neovim and Vim.
2. This means Neovim would delete data created by a different program, on another user's computer.
3. This was known before the feature was released.
4. They did it anyway.
I don't think there can really be any post-hoc justification of this.
https://github.com/neovim/neovim/pull/13973#issuecomment-789...
So the case is, you really need you undo history and want to try out neovim so you just copy paste you vimrc to the new place and accidentally delete your data? I don’t think it’s that bad personally. It’s bound to happen but it’s not automatic.
It seems the author has too high expectations of this feature, or vim is using an incorrect path to store this is they want to make it available more reliably
Not withstanding this incident, I would say that on the whole it has been a good experience with Neovim. (I didn’t actually ever use the persistent undo functionality in vim. Guess because of VCS it’s less needed for my use-case).
Unlike Dr. Chisnall, I started my editor journey on Neovim, so it wasn't a transition that bit me. However, if the format of the persistent undo file is unstable, and Neovim just deletes it when it doesn't recognize the previous format, then it seems conceivable (to me) that an upgrade after changing the format would delete the file too.
Ouch. This is making me think about getting off of Neovim. Yes, FOSS comes as-is, but if there's an alternative...
I could see ignoring the old undo data or warning before discarding it but just silently wiping it is so user hostile it’s hard to comprehend.
Edit: some great examples in the replies here, thanks! Perhaps I should start using it in editors that support it, never gave it a thought before.
It doesn't matter whether or not you can think of a reason you would want to enable it, but it should be pretty trivial to do so. Once you've enabled it, it should work.
I can give some as well. IDE crashes. Computer reboots at an undesired time. Even if my work is saved, I am not “finished”. I would like my undo history to extend before file / open time.
Moreover, the vim history tracking is amazingly advanced. It's almost like a mini version control system. I highly recommend getting to know it.
That fell apart when people wanted vim to do some more modern IDE kind of things like all the “… on save” stuff (build on save, test, lint, etc). I think LSP support is native in neovim as well.
I believe vim merged asynchronous plugin support a while back though, so I’m not sure how different they really are anymore.
The way I personally remember it being positioned was “Vim, but with breaking changes.”
The original author of this post (on Mastodon) appears to have a bone to pick with Neovim since it's "platforming white supremacists"? I couldn't figure out what this meant. Some sort of internet drama I guess.
https://github.com/neovim/neovim.github.io/issues/501
That's the wrong way to look at it. NeoVIM has a different concept of care for their users. They're optimizing for another kind of care, more in line with modern expectations, which VIM did not care about (hence the fork).
It's not better or worse, just different.
This same article could've been written about how VIM has no native LSP integration or autocomplete and they don't have duty or care for their users.
* https://news.ycombinator.com/item?id=49867678
* https://bastian.rieck.me/blog/2015/persistent_undo_vim/
Persistent undo exists to recover from an accidental write-and-quit mid-session nuking some stuff you really didn't intend to delete. If you care about its contents beyond a handful of hours, you either need to adopt proper version management, or start making backups.
Reading the PR the change was needed because the old undofile format was fundamentally broken. They considered making an undofile-upgrade mechanism, but it would've caused more issues that it would've solved. In other words: stuck between a rock and a hard place.
A duty of care also means occasionally having to break things to make it better, or else you end up being stuck with spacebar heating[0] forever. As a user it does suck, but that's the price you have to pay for using actively-developed software.
[0]: https://xkcd.com/1172/
On that board, silently deleting a user's files is obviously justified. What would be out of line is complaining about software silently deleting user files.
[1] Long ago. Galaxy far away.
Relax for a second. Get some perspective.
```markdown
abhorrent
/əbˈhɒr(ə)nt/
Abhorrent is an adjective that means morally very bad, hateful, or causing strong disgust and loathing.
```
I realise that this causes strong disgust and loathing in you, but can you please expand upon how it's morally very bad to prioritise speed and ease of use over undelete capability in Neovim? Are you unable to make backups or use Git?
> Are you unable to make backups or use Git?
Ah yes, the old perty theft justification as applied to intentionally-inflicted data loss; "They won't mind if I take/delete this, they (should) have insurance".
People are making it sound like this is a huge company with a product and not a grouping of curious people with a couple hours of free time on a Sunday.
Most likely they never thought about it, then it broke, then it was not impactful enough to fix on their free time compared to other stuff.
https://github.com/neovim/neovim/pull/13973#issuecomment-789...
If it's really just a toy with no expectation of not unexpectedly destroying user data then they ought to make that more clear.
But it is a nice feature.
I do that by using version control. I have it hooked to my editor so that "save" is "check in". Now I have persistent, versioned, copies of all my states independent of whatever tools I happen to be using.
You do not have all your states available.
I just tried it in Nextcloud Notes on Android (FlorisBoard has undo/redo buttons), and it seems to work this way. If I type a bunch of words quickly and hit undo, it removes all of them. If I stop for a couple seconds between each word, it undos them one-by-one.
This seems however more like of a documentation and UX problem. Neovim should warn and ask before deleting old undo files, or at least back them up, but it's not neovim's fault if people don't use reliable backup and versioning systems. Relying on persistent undo for this is kind of a self inflicted wound.
Use the proper tools for the job. Saying that neovim developers "had no concept of a duty of care to their users" is really disrespectful. Neovim's Lua API is overflowing with care, you just need to go look.
The feature's name has "persistent" in it.
They don't get a pass because you disagree with an imagined use case.
[0]: In spite of the author at Unsung saying that Neovim is "in news" for other reasons. Chisnall's account is being given in the immediate context of that news.
Seems so. As smart as keeping tabs open in browser instead of using bookmarks, but "workflow".
They live in ~/.cache which is defined as "user-specific non-essential (cached) data".
Despite this user's impressive résumé, they simply misunderstood the feature.
Or in the OPs case, installed a totally different application and was surprised by an incompatibility.
> Application cache data. Such data are locally generated as a result of time-consuming I/O or calculation. The application must be able to regenerate or restore the data. The cached files can be deleted without loss of data.
Meaning: the persistence of such files is not guaranteed across application restarts. If vim (and also neovim) had intended for the undo files to outlive the program, the files should have been put in ~/.local/state instead -- as also explicitly documented by the XDG [1]:
> [XDG_STATE_HOME] may contain: [..] current state of the application that can be reused on a restart (view, layout, open files, undo history, …)
[0] https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard#...
[1] https://specifications.freedesktop.org/basedir/latest/#varia...
(Or rather, you can, but you will likely be disappointed.)
It is counterintuitive in the same manner as when excel persists undo history chronologically across the running application process, and not separately per document.
Similarly AutoCAD intersperses application parameters and tool configurations alongside actual data operations in it's undo history.
Not on by default, you have to enable it in your .nanorc (not least because you need to provide a backup folder where you want to store these backups).
Very handy. Occasionally I've deleted files accidentally or made destructive changes, and could restore a working version from the past as if I had a timemachine.
https://infosec.exchange/@david_chisnall/117171776562702259
This story is about software being a slow, deliberate process where a lack of gatekeeping can lead to data loss. This is the type of problem which is getting worse.
We can speak, respectfully, of how important backwards compatibility is to us, and ask nicely for them to give more of their time to support it when their free sodftware isn't backwards compatible. Perhaps we can even offer to help implement it.
But they have no duty to do so or to "care" for their users. (They have already demonstrated they care for their users, btw, by giving them free software.)
EDIT: I missed an important part of the story, which is that they mutated existing files in a non-backwards compatible manner. That should have been avoided, I understand where the (secondary) author is coming from now.
I don’t care if you’re volunteering your time; if you build something whose implied purpose and success depends on other people using it, you emphatically have a duty to those people not to silently destroy stuff that was there before your software was.
If I fork chromium, I do not get to claim that I am a chromium maintainer.
Vim and Neovim are two seperate programs.
Even a gift comes with an implicit promise that it will do no harm. Deleting important data of yours without warning is harm.
That's such an obvious category mistake that I'm not sure how to respond. It almost feels like a bad-faith interpretation of Wichary's original point.
This is a great example of why. Most humans have a sense, deep down, that contracts often exist to bridge the gulf between the ethically defensible and the legally defensible.
It's hard to imagine that any sane person who is just looking to use a popular editor would read some broad limitation of liability language like the above, and interpret it to mean, "By the way, we intend to quietly delete certain files created by a competing fork of this project whenever we find them."
It's true that contracts with liability limitation clauses like this are an absolute necessity in this day and age. But there's also a non-legal principle of mutual respect that is absolutely necessary to a healthy open source community.
“Ow, the gas pedal is actually a bear trap.”
“Why are you complaining? It’s free!”
How does this translate to the vim situation?
The only way to "fix" this from a source code perspective would be to fork Neovim.
This is the extreme version of "I enjoy coding but I hate users."
It may be legally valid in absolute technical terms, but I'm going to take a lot of persuading that it's a healthy attitude.
But actually there is! They didn't start from scratch. They took another very successfull and beloved project with the promise "to make it better". There is some promise here and the duty not to make it worse.
How many neovim users were made aware that the software would proactively delete their decade-long file history?
By that logic, if Facebook gives away their services for free then they don't have the duty to protect their user's privacy and mental health?
And for what it's worth, I have flagged your comment for the inevitable pointless bickering it has precipitated. While applying reductionist frameworks and seeing where they lead is a necessary part of an individual's path to understanding, please avoid pushing ignorant assertions ("there is no duty here") as if they might constitute well reasoned truths.
And even mentioning that results in "fork it if you're not happy" which immediately turns everyone off who's had to maintain a fork to fix a minor issue in something before. And anyone who can't fork it is being told to go to hell.
Everyone needs to quite frankly get off their high horse, crank the ego down and listen to users. Because you're damaging open source with the attitude.
30 years ago, things were better. They got a lot worse, particularly since github appeared.
Yes, OSS can start with just a passion without a duty, but as the scale grows you have a duty to make sure it does not have adverse effect.
If you don't like the duty, just make it die by building it crappy like VIM does.
Don't forget time travel: `:earlier 7d`
Of the over a hundred students I taught when I helped out in uni, basically no one wanted to learn it, despite my enthusiasm.
And I sympathise. As I get older, I slowly grow more and more distaste for software that does not respect my time enough to give me properly-crafted defaults. Vim, in the age of modern editors, cannot compete. Not without 20 plugins with conflicting shortcuts and its self-imposed cliff of a learning curve.
And I’m saying this from a place of love; I’ve been using Vim (at least as a VSCode extension) every day for the last 10 years. But it never really grew up to the promise that the “Vim Creep” essay [1] gave me.
[1]: https://web.archive.org/web/20190227031109/https://www.norfo...
:wq
As for default plugins, it'd be neat if they curated a set of optional ones, but nothing should be preinstalled.
I dream of a Vim that wóuld guide and teach me how to use it, so that it does not scare away people because they can’t close it.
I dream of a Vim that embraces the needs of editing contemporary programming languages and fills in its UX gaps correspondingly (changes single to double quotes, anyone? Function argument order?).
I dream of a Vim with native Git gutters.
I dream of a Vim with sane default leader commands.
I dream of a Vim where I see line numbers by default.
I dream of a Vim where “Y” is consistent with other commands.
I dream of a Vim that detects correct indentation by default. And that can visualise whitespace.
I dream of a Vim where Ctrl+V does not have an assigned action that looks like it blocks input.
I dream of a Vim that experiments with keyboard ergonomics, not just mnemonics.
I dream of a Vim where quintuple-tapping Escape is not a habit I subconsciously form why learning it.
I dream of a Vim I stumble on people discovering and exploring, and not have to persuade people for months just to try it.
People of Raskin's vintage had a very humanist approach to computing. The mentality was very much an outgrowth of the cultural revolution of the 60s. Computer usage should be joyful rather than toiling. The computer should help you. It should make you feel good about what you create.
That stands in stark contrast today, where things are more hostile. Not just in terms of "Dark patterns", or writing off user needs for the sake of expediency... but even the way we talk about technology today. You need to use X, do Y or you're "not going to make it" / "escape the permanent underclass". It's bleak.
I recently restored a vintage Macintosh SE I picked up at VCF Midwest and despite its limitations that machine was an absolute JOY to use despite its limitations and nearly 40 years of age. This was a machine and software designed by Raskin's contemporaries and it shows.
That's just how people market things these days, preying on desperation and fear of missing out. It's not how normal humans talk, I hope.
And look at this article’s HN discussion. Many people indignantly defending it. “It’s open source. If you don’t like it deleting your data, don’t use it!”
Such amazing design...
" Enable persistent undo set undofile
Making privacy-sensitive features opt-in is a form of duty of care as well, to avert harm from the user.
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.
This was the end of the original Mastodon. Which is why I just can't with Mastodon or Bluesky. Casually tossing around ridiculous claims to back up an opinion on persistent undo.
I don't know if this story is true, but you can't defend it when taken at face value.
The point was they did it in a completely stupid way and responded to a bug report about it in a way that suggested this might not be just the occasional stupid that we've all had slip into our code.
Just by trying Neovim you can lose your vim undo file.
Some people just want to keep looking at the gift horse in the mouth.