It's amazing how many people don't bother implementing this indispensable feature.
- an "Auto save document when the active document is losing focus"
- Auto save interval
So I guess we are already covered :-)
BBEdit is almost bizarrely bulletproof in this regard. I never, in a decade, lost a single note. To me, this is probably the most overlooked and important feature in a text editor.
I switched to Plasma/Linux a few years ago and have since learned that Kate is not as robust.
Must try Notepad Next.
I don't even really use the concept of open files. I mostly switch files using a fuzzy finder that lists files in the git repo. So what files are "open" in my session is irrelevant to my workflow. (Unless they have unsaved changes of course, but I basically always just use "Save All" so even that state is minimal.)
I had to complete a resiliency test on our infrastructure and submit it to auditors for compliance reasons. I ran the tests, got the results, and I have to put it into a report. The report is like 30 pages long or more, but very little changes between each test (we do them quarterly). So I only usually change a few tables with the new report results, and freeflow some commentary in the discussion section that is unique for that run, so that the auditor feels special.
Anyway, I open up the previous quarter's report. I edit a bunch of data, write a bunch of useless commentary and go to "Save As" with the Q1-2024 suffix, and I realize the Word document had been autosaving my work the whole time on top of the Q4-2023 report. Urgh, very annoying. I didn't save intentionally because I knew I would save a copy later.
I was able to restore the old version through revision history, but still annoying nonetheless.
Notepad++ just saves a cached version of the file without touching the original until you explicitly hit "Save". If you close the file in Notepad++ (not exit Notepad++, but tell Notepad++ to close the file thus deleting the cache), it will ask whether you want to save your work.
If the intent is to not overwrite an existing file, I personally learned to make a copy first either via Save As in the program or by copying in whatever file manager I'm using. That way I make my intention clear to both myself and the computer.
I've actually burned myself numerous times because occasionally I would forget to copy first, instinctively hit CTRL+S frequently because I hail from before autosaving became widespread, and then realize I just overwrote something I wanted to keep as-is.
Because you didn't ask it to save and closed the app?
To address another commenter's point about word overwriting: auto saves should only go into a temp/separate file so as to never supersede manual saves.
If you quit the application when hot exit is enabled, it will restore all windows the next time you start it.
I don't see any way to close individual windows without prompting but you can do command+w and then command+d to "Don't Save".
While that's great, I wish the same thing existed for a lightweight Notepad-esque app, too: I used ++ a lot for quickly jotting down information while it was being read to me (so, on the phone); having to start a full-blown IDE for this seems wasteful, and not the right tool for the job.
Perhaps the solution is just to leave VSCode open all the time, but that wouldn't work either: whenever I switch workspaces, I'm asked whether I'd like to save the unsaved files (so, just like Kate), and it can be quite resource intensive. Grr.
Notepad on Windows now has this behavior. Finally.
After having used it for more than three decades, it now has the one feature that prevented me from using it to take scratch notes. It will autosave without prompting on close.
And it has a dark mode, so now I use it daily.
Version 41 (the one bundled w/Ubuntu 22.04 LTS) does have this behaviour from Notepad++
Rather quickly, I found that I had to completely remove Notepad so muscle memory would stop guiding me to it. Good times (and sad ones; I lost a lot of lecture notes) -- nevertheless, Notepad++ is an excellent piece of software.
I'm curious if the same "write and close the window" workflow is achievable with Kate, as I haven't been able to find the option; and, of course, the obvious question: what about this one?