Equivalent of Vim's swap files

I’m just wondering if this feature has ever been considered. Some vim users may find it annoying to the point of disabling it. But a great many users do not even recommend in doing so, as this prevents from recovering the file.

The users who are against it mainly complain about swp files littering the working directories or whatever path environment the editor points to.

As it is, :w by itself with nothing appended to it, or so I think and correct me if I’m wrong or I’m simply doing it the wrong way, is dangerous to the point of writing an empty buffer’s content into an existing file.

Recently some people have been exploring how Kakoune could be extended to support persistent undo. That’s probably the first step towards any kind of automatic recovery feature.

Thanks for the link. Appreciate it.

While Kakoune does not have swap files at the moment, in the case of a crash it will try to save every modified buffer onto the disk with a name like .${filename}.kak.XXXXXX, the rc/extra/autorestore.kak script will then automatically reload those version of the file the next time you try to open them, hopefully restoring it to the unsaved state (but not overwritting the existing file until you manually :write).