News for hackers. Stuff that matters.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by tentacleuno on Thursday March 28, 2024 @01:29PM (#39854782)
I very much miss Notepad++ for making quick notes, and then being able to close the window without being asked whether I'd like to save the document. This, and auto-save (so not losing documents if you forget to save) is one of the main reasons I replaced Notepad with ++.

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?

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by publius_0xf3 on Thursday March 28, 2024 @02:21PM (#39855488)
Occasionally, someone will submit their new text editor to Hacker News and the first thing I do is check if it quietly saves sessions upon closure.

It's amazing how many people don't bother implementing this indispensable feature.

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by jraph on Thursday March 28, 2024 @02:59PM (#39855945)
Kate can restore sessions, not sure it can auto save on close. Ctrl+L saves all but Kate will ask for still unnamed files.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by tentacleuno on Thursday March 28, 2024 @03:04PM (#39856003)
I haven't been able to get it to act like Notepad++, wherein it doesn't ask you to save on quit. Perhaps there's a configuration option I've missed?
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by jraph on Thursday March 28, 2024 @03:19PM (#39856175)
I'll look for it but I'm not sure I've ever seen it despite having seen the settings countless times. If it doesn't exist it could be an easy and useful contribution :-)
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by jraph on Tuesday April 02, 2024 @08:53AM (#39905174)
So, we actually have "Enable auto save (for local files only)" section, and two options:

- an "Auto save document when the active document is losing focus"

- Auto save interval

So I guess we are already covered :-)

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by tentacleuno on Thursday March 28, 2024 @02:38PM (#39855700)
I'm very glad others have come to expect this feature, too; I assumed it was another of my weird, niche workflows :-)
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by kzrdude on Thursday March 28, 2024 @07:10PM (#39858561)
Vim had this feature for years. But it took until I tested lazyvim (neovim distribution of plugins) that makes session restore so easily accessible, that I now rely on it.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by mikae1 on Thursday March 28, 2024 @07:32PM (#39858748)
> It's amazing how many people don't bother implementing this indispensable feature.

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.

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by kevincox on Friday March 29, 2024 @07:27AM (#39862757)
It's always amazing how someone's "indispensible feature" is something that someone else couldn't care less about.

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.)

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by nullindividual on Thursday March 28, 2024 @02:03PM (#39855229)
Notepad will now restore open files, like Notepad++ does. TextEdit on macOS does the same.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by MBCook on Thursday March 28, 2024 @03:03PM (#39855994)
It has been a suggested/encouraged default behavior on the Mac for many years at this point.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by adamomada on Thursday March 28, 2024 @03:20PM (#39856193)
It’s just yet another thing Apple gets right: why would the default be to NOT keep what you just put into the computer?
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by card_zero on Thursday March 28, 2024 @03:36PM (#39856368)
It seems to be the modern way, and normal on mobile apps, and I can't stand it. Why would I want the computer to save what I wrote without asking? I like being asked. I dislike computers trying to be clever.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by jacurtis on Thursday March 28, 2024 @06:17PM (#39858034)
This happened to me yesterday:

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.

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by dmonitor on Thursday March 28, 2024 @08:47PM (#39859318)
That's really annoying, but not quite the same as what Notepad++ (and presumably others) do.

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.

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by Dalewyn on Thursday March 28, 2024 @06:49PM (#39858354)
I'm inclined to agree with Microsoft Word's autosave, here. If you are making edits to a file, the implication (which could be wrong) is you're intending to overwrite at the end. And indeed, autosave came around because way too many people were losing document modifications to freak power outages and computer crashes.

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.

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by gradstudent on Thursday March 28, 2024 @07:44PM (#39858839)
As I read it, the GP complains about Word auto-saving on top of the OG document. I think intermediate changes should go to an auto-save buffer until you tell the editor to save over the top. For that reason I'm inclined to agree with the GP. Word's behaviour is wrong and the process you describe sounds like a workaround.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by nullindividual on Saturday March 30, 2024 @12:38PM (#39876368)
Office's auto save feature only works on OneDrive and SharePoint Online, which means every change is versioned. There is no 'overwriting' the OG document. The OP can go back in the history and recover it.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by NekkoDroid on Thursday March 28, 2024 @04:04PM (#39856673)
> why would the default be to NOT keep what you just put into the computer?

Because you didn't ask it to save and closed the app?

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by thereisnospork on Thursday March 28, 2024 @06:29PM (#39858169)
And if you misclick? Or there's a power outage? Or crash? Guardrails are nice and since I usually want to save what I've entered I appreciate it being the default behavior. Or in other words, I asked.

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.

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by mxuribe on Thursday March 28, 2024 @03:06PM (#39856015)
I don't think the core/default Kate editor does the same "write and close the window" like Notepad++. Kate does have pretty cool options for session handling - which helps keep files open that you had been working on, etc...which i understand is not the same thing. But, now that you asked, i wonder if there is a plugin or extenson for Kate that might provide such a feature? I myself am a fan of Notepad++, and install it on any corporate-issued Windows machine that i am given by dayjobs...but at home, its all linux all the time, so Kate comes closest for me. I did see someone else mentioned that there is something named NotepadQQ or something which is like Notepad++ but works cross-platform...so that sounds interesting if true. And, i wonder if NotepaddQQ has that auto "write and close the window" workflow?
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by TuxMark5 on Friday March 29, 2024 @03:45PM (#39868195)
Kate does support it. There is a checkbox somewhere in the settings to enable exactly this behavior. I use it together with sessions.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by mxuribe on Friday March 29, 2024 @07:20PM (#39870126)
Nice! I will have to check that out. Thanks!
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by mxuribe on Saturday March 30, 2024 @01:53PM (#39877015)
Confirmed; just as you noted this functionality from Notepad++ exists in Kate!!! I guess i now am fully going to dive in to Kate even for Windows (nothing against Notepad++, but no need for it now)! Thanks!
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by dailykoder on Thursday March 28, 2024 @04:34PM (#39856977)
Have you tried neovim? It just works and is blazing fast (respectively plain vim, if you don't need plugins)
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by kayodelycaon on Thursday March 28, 2024 @03:32PM (#39856334)
You probably already know this. VSCode has both autosave and hot exit features.

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".

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by tentacleuno on Thursday March 28, 2024 @03:35PM (#39856367)
Oh yeah, VSCode's autosave has saved me hours in otherwise-lost code. I do make frequent use of its hot-exit functionality, too.

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.

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by SV_BubbleTime on Thursday March 28, 2024 @07:14PM (#39858596)
Not just the auto save, but that it is using GIT on the backend for the timeline. Such a helpful feature!
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by teekert on Thursday March 28, 2024 @03:10PM (#39856059)
Fwiw, I do this in Obsidian (it just saves every keystroke), really enjoying it.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by thrdbndndn on Thursday March 28, 2024 @02:01PM (#39855201)
it's achievable with default notepad.exe in Win11.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by abgiva on Thursday March 28, 2024 @05:36PM (#39857609)
Try CudaText.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by noisy_boy on Friday March 29, 2024 @03:37AM (#39861530)
Its a pain to install due to dependencies on libqt5pas1 (which doesn't work with the version provided on Ubuntu 22.04). I was able to install via snap but it takes way too long to start up (even vscode starts faster).
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by EMM_386 on Thursday March 28, 2024 @05:45PM (#39857722)
> being able to close the window without being asked whether I'd like to save the document

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.

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by aftbit on Thursday March 28, 2024 @05:46PM (#39857737)
I never noticed this. I just hit Ctrl-S obsessively in every application. I heard that once upon a time, vanilla Notepad ignored Ctrl-S. Horror!
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by izoow on Thursday March 28, 2024 @06:19PM (#39858060)
I've been using Sublime Text to do this. I use VS Code/Neovim for my programming, but Sublime Text is still way too convenient as a notepad to keep around, one of the main reasons being this feature.
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by raudette on Friday March 29, 2024 @08:33AM (#39863292)
Is anyone aware of an editor in Linux that has this behaviour?
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by roywashere on Friday March 29, 2024 @08:55AM (#39863511)
Modern gedit on gnome has it
Re:NotepadNext – a cross-platform reimplementation of Notepad++ by raudette on Saturday March 30, 2024 @11:02AM (#39875507)
Which version? Or what enables it?

Version 41 (the one bundled w/Ubuntu 22.04 LTS) does have this behaviour from Notepad++

Re:NotepadNext – a cross-platform reimplementation of Notepad++ by remotefonts on Saturday March 30, 2024 @12:38PM (#39876370)
Geany. Not sure if by default or of it needs to be turned on in the settings. And Geany can be anything from a simple text editor to a very nice IDE.