5 ms·
Just a suggestion. One of the best features of pure text editors (and incredible, not all of them implement it) is autosave keeping the "unsaved" state of the f
by llagerlof 2y ago
Just a suggestion. One of the best features of pure text editors (and incredible, not all of them implement it) is autosave keeping the "unsaved" state of the file.
For example, if you make some changes in a file (new or not), don't save the changes, close and open the editor, the state of the opened files are kept like I never had closed the editor. The unsaved files are still unsaved. New edited files are still there, unsaved, ready to user manually save them.
Notepad++ works that way, and it is an amazing feature.
- misternugget 2y agoWorking on it!
- sa-code 2y agoSublime works this way and I do appreciate it
- shitlord 2y agoI have a tab in Sublime Text for my todo list, which I created several years ago and never bothered to save. It's a great feature for indecisive procrastinators.
- mhuffman 2y agoJust an fyi, I have shot myself in the foot with Sublime's version of this. I became dependent on using unnamed/unsaved documents for quick notes, then at some interval I would clean up. And because Sublime would remember, I could rest safe that they would be there even if closed and reopened until I cleaned them up myself. Well, I also got so hooked on Sublime, I set it as my default system text editor. Then, (more than once), I would click a downloaded text file or something that would open in another window. Then after browsing or something I would be back in my original Sublime window. Close it for the day and as I was closing other windows realize there is another Sublime window still open with that document that I read early ... and all my other temp notes were gone! If you are good at grepping you can still find the files cached on your system with a little work, but something to watch out for. Or just get used to saving files somewhere.
- eviks 2y agoYes, never trust features like these for anything important, we're just not in that era of computing where losing user state is a cardinal sin. Had the same issue. Though you could use a shortcut to quit the editor instead of closing windows
- ben-schaaf 2y agoNote that Sublime Text always prompts for each unsaved file in cases where their content could be lost. We heavily prioritize issues with data loss. That being said I still wouldn't recommend keeping important stuff unsaved, really they should be fully backed up like everything else important.
- xavxav 2y agoI did the same thing, with the same limitations for years, but I've transitioned to using the tiny package `DailyOrganizer` which can create a note for each day, along with a small custom command to open my note directory in the quickpick (to browse old notes). Having this has meant that I just throw notes down, maybe I forget them maybe not, but it at least they'll be saved properly.
- zamadatix 2y agoI'm trying to follow how this can happen as I use Sublime's cache feature for temporary notes between meetings and want to make sure there isn't some corner case I've just not run into yet. The two related scenarios I can grok from this are: - Create unsaved or modified versions of saved documents -> close Sublime completely (no prompt, documents go to cache) -> open download.txt -> new window has tabs for the cached documents and a new tab for download.txt - Create unsaved or modified versions of saved documents -> open download.txt in a new Sublime window (2 windows open now) -> try to close unsaved/modified documents -> get popup warning that changes will not be saved (because it isn't the last window so they won't be saved for the session persistence) But both of these are safe (i.e. you don't lose anything unless you click the button saying you want to lose something) so there must be another path to failure I'm missing.
- 2y ago
- TremendousJudge 2y agoAtom worked that way as well
- rbanffy 2y agoI wouldn’t mind auto saving and allowing me to undo changes from the previous session.
- stavros 2y agoIs this if you close the entire editor? If you just close the file, do the changes remain next time you open it?
- 369548684892826 2y agoJust if you close the entire editor. Editors with this feature, if you close the file it will ask if you want to save changes, click no and the changes are lost.
- stavros 2y agoThat's very good UX, I really like that. I wonder why it's not more widespread.
- vunderba 2y agoIt's more common than you would expect in IDEs: VS code, sublime, notepad++, though I would love to see it adapted to other types of software such as audio, graphic editors, etc.
- vbezhenar 2y agoHow do I do that in vscode? When I'm trying to close vscode, it asks me to save unsaved files.
- mintplant 2y agoSimilarly, I have unlimited persistent per-file undo turned on in Neovim. I can open any file I've edited previously and walk through the full history of how it got there. With Undotree [0], I can even navigate branching paths in development. I don't know how people live without this. [0] https://github.com/mbbill/undotree https://github.com/mbbill/undotree
- rustyminnow 2y agoWhat are your undo settings? I set undofile and undodir, but not sure if it's unlimited. One issue I have is if nvim is closed and the file is touched by some outside process (say git pull) it clobbers the history. Do you know if there's a fix to that?
- koonix 2y agoOh yes there is: https://github.com/kevinhwang91/nvim-fundo https://github.com/kevinhwang91/nvim-fundo
- mintplant 2y agore: undo settings, I set my `undolevels` [0] to a very high number to make it unlimited for all intents and purposes. [0] https://vimdoc.sourceforge.net/htmldoc/options.html#'undolevels' https://vimdoc.sourceforge.net/htmldoc/options.html#'undolev...
- zelphirkalt 2y agoI think Emacs does this too, if you configure it, or even by default, using its backup files, that go by #some_name# or similar.
- jhoechtl 2y agoWhile I love Emacs it's not like this. Scratch buffer? C-c C-x and all is gone without any warning.
- worthless-trash 2y agoScratch is (I think) intended for use for executing 'this session' elisp code as the buffer is set to lisp interfactive mode, not intended for where you store your scratch text. Other buffers behave differently, maybe scratch isn't useful for a large number of emacs users, however scratch is working as designed.
- abdullahkhalids 2y agoThere is a remember-notes feature that isn't deleted [1]. Or you could just set up so you can't kill scratch (see first answer in [1]). [1] https://emacs.stackexchange.com/questions/19254/never-close-scratch https://emacs.stackexchange.com/questions/19254/never-close-...
- emporas 2y agoEmacs definitely does this. I have saved many files from power outages. M-x recover-file, but the user has to recover the file right away when he opens it again or else a new auto-save will overwrite the old one. I think that's the case.
- TiredOfLife 2y agoJetbrains ides even have something like a shadow git.
- ziml77 2y agoEven Windows Notepad supports hot-exit now.
- 8372049 2y agoAnd dark mode! And tabs! I love notepad.exe of the future. What a time to be alive
- andrepd 2y agoSo does sublime. Indeed I rely on this behaviour almost unconsciously.