NotepadNext – a cross-platform reimplementation of Notepad++
github.com
github.com
SciTE [1] is the "official" demo-editor for Scintilla and was last updated on March 9th 2024. The history reaches back to 1999.
M-x lsp-rename in emacs, for example works great, if you're using lsp.
Have two thousand strings which all need the same edits? No need to do a find/replace operation, you can do it directly in the editor.
[
"foo bar/2322",
"foo baz/4223",
"foo blah/2232",
...
]
And you need to reformat that into: [
"bar 2322: foo",
"baz 4223: foo",
"blah 2232: foo",
...
]
You can absolutely use a regular expression find/replace to solve this. But using multicursors, you can just highlight the first "foo ", then hold Ctrl+D to select all instances, then hit right arrow key so that your cursors are at "foo |bar/2322" (and nothing is selected) et al, then use shift+right arrow key to select bar, baz, blah, and all other substrings, then use ctrl+X to cut that list to your clipboard. Hit delete key to get rid of the /s and add a space so you can keep the fields separated. Then, use ctrl+arrow to move your cursors to just before foo ("|foo /2322"), paste, hit space. Now you have "bar foo 2322". Repeat the same action to cut all the "foo" substrings, then move your cursor to the end, now type ": " and then paste.You get the idea. It sounds complex, but these are all just comprised of the same fundamental editing patterns-- all of the cursors act as if you had just that one cursor when you press the keys. You have to play with multicursors to really appreciate their power.
Most of the time, someone who is well versed with multicursors and their editor's cursor shortcuts (arrow keys, page up/down, shift/ctrl arrow keys, etc) will be able to complete these sort of textual manipulations much faster than using find/replace.
The benefit of it is that you're left with a cursor in each location, and you can then do absolutely anything that you'd normally do with a single cursor in every place at once. This includes things like copy/paste, which will maintain a separate buffer in each selection. This also includes things that're actually tough to do with normal find/replace -- I could select the bit after a search result and switch it to title-case, for instance.
You can do most things you'd use it for with find/replace. But sometimes it's easier to watch it happen as you type, rather than construct a fairly complex regex with groups and suchlike.
I might be missing something here, but how is making 2000 individual selections better than `:%s/oldstring/newstring/g`?
I'm guessing that you have a rule for setting up those 2000 selection, or something?
I mean, even for like 5 identical edits, the regex is going to be faster, so you must have a short way of performing the multi-selection.
Also when working with lists it is useful, you spawn cursors on , or < or whatever symbol you've got at a fixed location between lines, and then you can manipulate text in any number of otherwise different lines.
* transform a list of field names into different formats (class properties, sql select list, etc.)
* quick and dirty convert delimited text into insert statements or graphql queries or json objects
* really anything I need to change in column mode but with better tracking of words via mod+arrow keys
Multicursors are the number one editor innovation of the last ten years that developers should get comfortable with-- once you start to use them you won't want to use an editor without them.
As for regexps, the syntax in Emacs is hell, but I do know Emcacs has very powerful edit/replace tools.
Video showing this https://youtu.be/lhFNWTAIzOI?t=28
I also haven’t found a use for multiple cursors.
Writing a regex is quick and easy.
With regex, you need to plan everything you need to do and then surgically do it.
With multiple cursors, you only need to know (roughly) where you need to change, the rest you figure it out on the fly.
I've been wanting/meaning to make a new text editor using SciTE as a base, just adding in that core functionality that I need, but I haven't got around to it.
If this NPN uses flatpacks I'm not really interested though. I want something super lightweight and fast that can be run as close to standalone as possible.
Might be time to move the text editor project to the top of my list, since it seems other people would probably also appreciate it.
Unfortunately, I don’t really see how you could make a standalone GUI app of meaningful scope on Linux, given the platform that “standalone” is usually defined with respect to doesn’t include a widget toolkit or even a font handling library (it does on Windows). I guess going it alone with an OpenGL viewport would work, but that’s also just setting yourself up for pain the minute accessibility, font shaping, or input methods come into the picture.
I won’t begrudge anyone writing their own toolkit or shaper, it’s just, that’s far too much work to do for the sake of being “standalone”. For the ideal of doing everything yourself, yes, I can definitely sympathize, but just getting rid of DT_NEEDED records isn’t much of an ideal.
Fair point. I meant able to run without needing any special libraries above those that can be assumed to be installed on a standard linux desktop.
It's more or less a way for standaline plugins/programs to provide language-specific functionality like autocompletions, syntax-highlighting, and diagnostic errors (like type errors) independently of a specific editor.
The idea is that standalone programs are made called language servers which can provide these features. Editors tend to communicate with them using JSON-RPC over stdin. So one can only write a language-specific parser once and integrate it with any editor.
Usually (at least in VS Code), there's a third part which is an editor-specific plugin which contains custom code to connect the editor to the language server, but this part is meant to be a thin layer.
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?
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.
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.
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.
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.
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.)
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++
>The only way for one person to even attempt cross-platform app is to use a UI abstraction layer like Qt, WxWidgets or Gtk.
>The problem is that Gtk is ugly, Qt is extremely bloated and WxWidgets barely works.[0]
To be fair, a PDF reader and a notepad editor are two different things, and startup speed is only one metric which is the only one I tested. But I always assumed npp was also using win32 APIs only for similar reasons. (I don't actualy know what GUI toolkit npp uses.) And "bloated" could perhaps mean a lot of things. Perhaps QT takes more memory or something. But I always assumed npp's unbeatable speed was due to native APIs.
[0] https://blog.kowalczyk.info/article/2f72237a4230410a888acbfc...
Personally, I find that making every part of the UI an active control makes it easy to do things by mistake, especially hiding elements, which often doesn't have an obvious way to reverse the process. For one-time UI setup, I don't mind going through a dialogue box.
It supported a lot of languages.
(might be also 10 years, since I tried it the last time)
* They encourage curiosity about previously undiscovered functionality. It improves feature discoverability.
* It's way easier to find the correct tool bar icon than trying to hunt for a feature inside the menus.
* If some toolbars are highlighted or disabled can tell you information about the state of the document you are editing.
Absolute beginners should be shown a basic interface front and center, with a clear way to access more advanced features. More advanced users may benefit from a plethora of rich controls, all shown together. Experts may want to remove the visual clutter because they access features from keyboard without looking.
Good software offers a way to achieve all of these, and often more customization.
FreeCAD does this well.
I really disliked the relatively dumbed down ribbon UI when it first came out.
What? I am just completely confused by this—menu items are labeled in clear textual language, sorted roughly by functionality. icons greatly depend on cultural context. Looking at a screenshot of notepad++ I could would understand maybe a third of the icons and could guess at another third at best.
That said, it's not that big of a deal—I'd probably just disable the toolbar rather than figure it out. I don't really use the mouse outside of selecting regions of text anyway.
Granted, I don't use windows so it's entirely possible I'm just showing my ass here.
I have no idea what "up arrow on top of down arrow" is though, because I don't have that button.
A toolbar that’s populated only with the most frequently used functions and employs full color, uniquely shaped icons can be visually grokked in an instant, whereas a densely packed toolbar full of glyphs is inscrutable at a glance.
It’s when they’re not fully customizable and aren’t optional when they grate on me.
Less cluttered but with more white space, especially in the vertical direction which is particularly cramped since the change in monitor aspect ratios so the toolbars have less functionality but take up more of the usable screen space.
Progress is great…
I used to put the task bar vertically down the side of the monitor as well for the same reason but Microsoft won’t let me do that anymore.
I've tried the various hacks available for Firefox to achieve a similar result, but nothing comes close to Edge here. Closest I got to edge is Midori, though unfortunately that one is still pretty buggy.
The new commit window alt+0 is better, the old modal always felt tacked on when everything else is a docked panel.
I'd like my JetBrains IDEs better with a 10x speedup. The new redesign isn't bad if you memorize keyboard shortcuts :-)
Contradictio in terminis
I still like at the old UI.
When you do overlapping windows, those non standard chrome are great distraction.
That's the joke :-)
I usually switch off the menu bar in Emacs, and I don't even know if it can be turned on in Vim.
[1] well except for a brief 2 year VSCode spell but i came back a year or so ago and have restored my all products subscription
The main detractor is indeed the hamburger menu. Vscode had ctrl-p, emacs has alt-x, and both provide a way to search for some function to execude. I hope Jetbrains is hiding something similar in its innnards, but haven't found it yet. Ctrl ctrl isn't it, at least for me.
I went all-in on Jetbrains Ultimate last year without regrets. The thing is great and powerfull, but it is hard to find what you need in there, and hard to find out what is the purpose of some functionality. I've actually lost usefull functionality: Something usefull but I don't remember the name and can't find it in the menus. I should spend some time spellunking in there. Even so, I hope they find something better than the hamburger or the zillion hotkeys.
emacs and vscode treat this function as a primary entry to the functionality, and have tuned the names and namespacing to this kind of usage. E.g. vscode has micropython:configure project.
This is a search function for the existing gui with reuse of existing names. As the surrounding context is lost, it is hard to say what a name means.
ctrl+ctrl is "run anything" (I tend to use ctrl+alt+r for the different but similar run menu instead).
I think what you want is "Actions" - which is default to "shift shift" and then click on a tab, or (ctrl/cmd)+shift+a to jump directly to that tab.
I like all the buttons and menus etc visible right there without needing extra clicks. When working with colleagues I can see them struggling to find features that I have been using with old UI for my advantage because it's all out there in front of you and they don't even it's possible.
That's a feature. It's a GUI harkening back to Windows Explorer Classic, aka the interface style used from Windows 95 through Windows XP.
The Ribbon still feels to me like that "new thing" Microsoft did since some version of Office... and you're telling me it was 2007?!! Oh my...
A bit before that time I already moved to Open/LibreOffice, and never really used any Windows past 7, so I've missed a whole UI paradigm transition that now makes Windows feel like a complete stranger to me.
I recommend giving it another look.
I actually do lol
I agree. I used to use N++ when that sort of interface was common everywhere. It didn't look as out of place.
These days I find it too jarring and either use Sublime Text 3 or just regular Windows Notepad for scratch notes (now that it doesn't prompt to save on close anymore). No buttons.
I'm writing a block editor in Qt C++ (Npp is also written in Qt) and QML[1], so I'm very curious. I load the entire text and then render it using a virtualized list (ListView). My app is currently the fastest block editor that I've tested. But I always want to take it up a notch and even compete in performance with Sublime and BBEdit, and now NotepadNext.
[1] https://www.get-plume.com/
EDIT: It's REALLY fast and very efficient (consumes low amount of memory). Seems to be faster than BBEdit (unscientific). If anyone has a clue about the architecture or can share a link, it will be appreciated.
That's been my preferred editor for a decade, but massive files have always been a pain point.
Looking forward to giving this a try!
Edit: Kate is great, give it a shot!
(For the Windows machines that my dayjobs issue me, I still use Notepad++ since funny enough that is easier to allow then requesting to install Kate! Corporate world be getting all strict on software installations nowadays - yikes!)
As someone coming from Windows, it's crazy how bad GTK apps look for desktop. Crazy. Like I can't comprehend how did it get to this point.
Just compare the screenshots
https://www.geany.org/media/uploads/screenshots/geany_light_...
https://notepad.plus/wp-content/uploads/2023/03/screen.gif
Notepad has 16 toolbar buttons in the same amount of width that GTK can only fit 10 toolbar buttons. The height of the tabs and status bars are also MUCH shorter. It's completely ridiculous and makes every GTK app look bad to me. Not just Geany, but Xed, Pluma, Gedit, the image viewers, the file managers, the system settings dialogs, etc. I have a mouse. I can point at things. I'm not using my thumbs or toes to operate a desktop app.
Qt's licensing sounded a bit weird. At first I thought your app HAD to be open source to use it. But once it was clear to me that you can sell apps made with Qt so long as you dynamically link without having to pay royalties or anything, the choice was clear. If I have to program an app for Linux, I'm using Qt.
And so far the only problem I found in Qt is that it uses the system's "native" GUI by default (i.e. it uses Gtk on Linux). This means that the Ok-Cancel buttons are Cancel-Ok instead of the correct order. Who puts Ok buttons at the right side? Now if I want to quickly close something, I'm clicking at the corner of the window which is the easiest point to click at, and on the top right I have close (which cancels) and at the bottom right I don't have cancel but Ok which COMMITS which is the opposite of what a thoughtless rash speedy click is supposed to do. Ok should be at the left so you can't commit things by accident. The only reason to put it on the right is if you're designing for tablets so the ok button is closer for right-handed users. This isn't how a decision for a desktop-oriented design.
Kate is awesome. It’s cross platform as well.
Link for the lazy
Looks like an IDE more than a notepad, with the side bar browser, but then I suppose it's a small step up from NP++ (with syntax highlighting and ftp^W git support already built in) to a fully fledged programming environment. Spotted the all-important keyword "vi bindings" also. I should give this a try!
Bit sad it won't work on remote systems (without inefficient X forwarding at least), but I've been looking to try out a new editor and e.g. not having to deal with things like O timeout (apparently that looks indistinguishable from the start of an escape sequence and so the command line has to wait to see if the rest of the sequence follows) has advantages as well
AIUI
There's the editor embed-able component, kedit.
A basic editor based on it, kwrite.
Then the more fancy editor program, kate.
And the IDE, kdevelop.
I don’t think NotepadNext appimage or flatpak will be able to match Npp in regards to memory footprint and ui responsiveness.
But, I am excited to use it and it may find it’s way onto my thumbdrive because it runs natively on Linux so it doesn’t depend on wine.
** it's sort of free, the trial period is unlimited. It just gives "activate me" popups every dozen file saves or something.
Heh, I'm glad you found the light in the end =)
I remember that I first tried out Vim during an internship with a boss that was less than receptive to me trying out things I heard about online, like the way he pronounced "wtf is dug..dug..go?" when I did a search query, or the weird look gvim got... I guess I was a bit more prepared for the Linux life by having seen Vim before, but still it was surprising nobody built NP++ for Linux and that there was nothing better than Geany available in terms of NP++-likenesses. It seemed so simple, how can it not exist? Apparently the simplicity is deceptive
Today I learned something new.
geany, codeblocks, and np++ are all scintilla, so what I am really saying is I use both "something like vim or emacs" AND scintilla, and there is no dichotomy.
And what is "something like vim or emacs"? The two are nothing like each other.
Anyone who used either vim or emacs already knows why they do so, and already knows that none of the reasons anyone will say they like any normal editor will apply. Everything anyone says will either be something vim or emacs already has their own answer for, or will be things they actively don't want.
Question seems somewhere between disingenuous to inexplicable. I would say rather than an actual request for information, it was just to say "I like vim or emacs", except "I like vim or emacs" makes no sense because they are not substitutions for each other.
You don't need to worry about modes or plugins for language syntax highlighting for most file types as it's built in.
For a considerable time in my professional life I was forced to use Windows. I would still have access to Linux VMs, in which I spent most of my time, using vim as the editor but whenever I wanted to take quick notes, sanitize text, stash away some info I need in work etc., I'd just use the notepad on Windows.
Then I found Notepad++. The UX is just so great (though I never figured out how to delete all the line ending spaces and it's sometimes nagging me).
So I love both Vim and Notepad++, different use cases. Different reasons.
Do you mean extra spaces at the end of line? If yes then select the lines, go to:
Edit - Blank Operation - Trim Trailing Space
Not saying that they would allow but it'd help the community as a whole with less duplication of work and deliver more features.
I got pretty good with it, even making custom macros and the like, and as I was learning C and C++ on Windows it was still the text editor I used.
The reason I stopped using it really did just come down to the fact that it didn't work on Linux. I had already been dual-booting Windows by 2011, and when Windows 8 got announced I utterly hated it so much that I decided to just do Linux full-time. While I was aware that Notepad++ worked on Wine, I didn't really want to muck with anything emulator or emulator-adjacent, so I just picked up Emacs and Vim (went back and forth for multiple years until finally settling on Vim).
I will need to look at NotepadNext. NeoVim is great, but sometimes I want a simple, non-IDE, GUI text editor as a place to just dump notes down.
I use Vim for coding and even writing Markdown docs, the thing I like using GUI text editors for a place to dump copy/paste stuff, writing down phone numbers real quick, quick stuff I can click and copy-paste from. The console version of Vim is fine, but getting stuff to and from the system copy buffer is a bit cumbersome.
I read that those would spit out sub-optimal HTML and you should use a text editor. So I downloaded Notepad++ and I learned real HTML using it.
https://liquidninja.com/metapad/
Development on it has stopped, IIRC, but it is still available for download.
I had used many other text editors earlier, such as TextPad, NPP, SciTE, PFE,etc., over the years .
Power and love be to all the alternative text editors out there though.
NotepadNext: A cross-platform reimplementation of Notepad++ - https://news.ycombinator.com/item?id=30959025 - April 2022 (273 comments)
I hope this will be compatible with np++ plugins which makes np++ even better.
> Plugin compatibility between NN and N++ is not possible.
https://github.com/dail8859/NotepadNext/issues/422
Shame, since N++'s plugin ecosystem holds quite the treasure trove of functionality.
https://github.com/notepad-plus-plus/nppPluginList/blob/mast...
Thanks for the trip down Memory Lane.
I think NotePadNext will still remain primarily a choice for windows users.
[1] https://zed.dev/
That said, from memory, it actually works well in Wine, but plugins can be iffy.
I’d still use it for more complicated things but very rarely..
Eventually I figured out it only reloaded the file if you can few enough tabs open so I could just open a bunch of other files, let it crash, open some more and then eventually it wouldn't load the huge file, so I could close the tab. But still, such a pain.
It was many years ago and I was young and stupid, so there's probably a much better way. But I've moved on to Linux and to Emacs now
edit: flatpak support is just chefs kiss.
I also like Micro a lot - it uses the command line as a GUI
I use Geany on Linux, it is the closest replacement I have found. Until now.
[x] Restore previous sessions [x] Unsaved changes [x] Temporary files
>By default, MacOS enables font smoothing which causes text to appear quite differently from the Windows version. This can be disabled system-wide using the following command:
Does any sane person on a Mac want to have a Windows look, especially when it comes to fonts? Looks crazy to me.
Probably? There are a lot of Mac users.
After reading the title I was 99% sure it would've been an Electron app, nice to see it's actually native. Good work.