Live data from Hacker News

Writing my own text editor, and daily-driving it

blog.jsbarretto.com

81–90 of 124 posts

Re: Writing my own text editor, and daily-driving it

#81

Earlier quoted context omitted.

That's true for code editing, but it's nice to not have to reach for a different solution when editing huge files. Sometimes I like to open up big log files, JSON test data, etc.

Do you actually edit big log files?

I interactively pare down log files to just the parts I need. I rarely save the result

Re: Writing my own text editor, and daily-driving it

#82

Earlier quoted context omitted.

Several of the lean GUI text editors are built on Scintilla ( https://scintilla.org/ ), which provides a cross-platform editing component that can be integrated in GTK, Windows or Mac GUI apps. Maybe that has too much bells and whistles for you, since it's both about editing and presentation.

I guess I might be misunderstanding what Scintilla is? Everything I've seen with it has it coupled with native controls, like a winform control or a Qt control. Are you saying that the library can be used, on its own, without a graphical component? If so, that might fit the bill!

Yes, Scintilla is a text editor engine library. It's not tied to any particular UI or technology. Out of the box it's not a text editor yet; you provide the frontend. You get all the "table stakes" right away if you build your editor on this library.

Here's Scintilla driving a TUI text editor: https://github.com/magiblot/turbo

Here's Scintilla driving a custom GUI control (not the system text control): https://github.com/desjarlais/Scintilla.NET

Same engine, different frontends. The engine has a series of hooks that you implement in whichever way you please for your particular interface. It's definitely the presumptive choice here.

Re: Writing my own text editor, and daily-driving it

#83
post #42

Earlier quoted context omitted.

I'm quite partial to Zed. Very snappy, and you can turn off all the AI features globally if you like.

Zed is fantastic for Rust, C, C++, and similar languages. I wouldn't bother using it for Web things like HTML, Js, CSS, because it simply isn't better at that than VSCode. Same goes for C# -- as a Microslop technology, you're better off using Microslop tooling.

I don't find Zed much worse for working with webtech either.

Re: Writing my own text editor, and daily-driving it

#84

This was so nice to read, I've been trying to encourage my friends to write their own editors, there's something really nice about the process of working within your own tool. I've used my own text editor(it's call Left) for nearly 10 years, it took time to get it just right, but I iterated over the years(using Left to edit Left) but that time I spent putting it together is paid back 20x by the joy it gives me openin…

I'm 19 years into using my own ("aoeui"), and it's one of the best things I ever did for my own productivity.

Re: Writing my own text editor, and daily-driving it

#85

Earlier quoted context omitted.

I guess I might be misunderstanding what Scintilla is? Everything I've seen with it has it coupled with native controls, like a winform control or a Qt control. Are you saying that the library can be used, on its own, without a graphical component? If so, that might fit the bill!

Yes, Scintilla is a text editor engine library . It's not tied to any particular UI or technology. Out of the box it's not a text editor yet; you provide the frontend. You get all the "table stakes" right away if you build your editor on this library. Here's Scintilla driving a TUI text editor: https://github.com/magiblot/turbo Here's Scintilla driving a custom GUI control ( not the system text control): https://gith…

Ah, I see! Very cool! Yeah, this is the kind of thing I was looking for, so this should give me what I need to test some proof of concepts. Thanks for the links! I do wish there were something a little more ergonomic, but I'm way too far into the begging to be choosing, here, so I'm quite happy to take what I can get.

In any case, I really do appreciate the dual links. It's so much harder to suss out the boundaries of a library with only one implementation. This was really helpful.

Re: Writing my own text editor, and daily-driving it

#86

One of the best kept secret and one that he should have tried is "Kate". Good old style editor that is a native app, not an electron app. All the features that you might want and more, but simple and efficient. And the most important for me, super snappy. I can't bear the latency that you get for typing code when using things like vscode. I don't know how people can appreciate that.

I'm quite partial to Zed. Very snappy, and you can turn off all the AI features globally if you like.

Zed is a no go in my book until they learn to respect their users and stop installing third party software* without asking. Completely unacceptable practice, and their reason of "most people will want LSPs to be there without effort" doesn't cut it.

* nodejs specifically, but it wouldn't be ok no matter what the software was. It's my computer, not yours, don't download and run stuff without getting permission.

Re: Writing my own text editor, and daily-driving it

#87

One of the best kept secret and one that he should have tried is "Kate". Good old style editor that is a native app, not an electron app. All the features that you might want and more, but simple and efficient. And the most important for me, super snappy. I can't bear the latency that you get for typing code when using things like vscode. I don't know how people can appreciate that.

I agree about Kate.

In addition while kate has many plugins, like the one that allows running arbitrary command line utilities with std input the current selection, I would like to point you at something else in case you write / debug SQLs.

Kate has a SQL plugin that allows to send the current selection to the connected SQL server for execution. It displays the output in table form below the editor pane and you can copy paste rows or columns.

That allows to organize your SQLs in markdown files. That was such a productivity booster for me that simply there are no words to describe the difference felt.

Re: Writing my own text editor, and daily-driving it

#88
post #55

Earlier quoted context omitted.

Yes, I remember writing a VB6 driven editor. I was so happy when I got find and replace to work. I still have the marketing page copy from 2002: Unlimited fully customizable template files Fully customizable syntax highlighting Very customizable user interface Color coded printing (optional) Column selection abilities Find / Replace by regular expressions Block indent / outdent Convert normal text to Ascii, Hex, and…

This is definitely aging me, but I'm still disappointed that all caps didn't win. That style made it so much easier to visually parse tags when scanning through the HTML code. I admit that syntax highlighting has mostly done away with that benefit, and now that I'm used to the lower case I don't mind it anymore, but the uppercase always felt better to me. Even reading that example above it feels more natural. Style i…

I agree, even with syntax highlighting it visually looks more appealing in caps.

Re: Writing my own text editor, and daily-driving it

#89
post #49

One of the best kept secret and one that he should have tried is "Kate". Good old style editor that is a native app, not an electron app. All the features that you might want and more, but simple and efficient. And the most important for me, super snappy. I can't bear the latency that you get for typing code when using things like vscode. I don't know how people can appreciate that.

Every piece of KDE software I've tried has been buggy to the point that it's now a red flag to me: Spectacle (silently failed to copy/paste), krunner (refused to close), SDDM (refused to login), Dolphin (ffmpegthumbnailer loops lagged out whole system, SMB bugs), System Monitor (wrong information), KWallet (signal fails to open, data loss)

Copy pasting images is often hit & miss.

Sometimes I have the image copied but it doesn't paste in the browser. However it can be pasted to GIMP. If I paste it there and copy it from GIMP then I can paste it to the browser.

So who's fault is that? Spectacle's or browser's? Maybe wayland's?

Re: Writing my own text editor, and daily-driving it

#90
post #53

This feels like two steps up from a highly customized vim config. But I want one step up. I want to be able to piece together an editor from modular task specific executables. Different programs for file searching, input mapping, buffer modification and display, etc. Probably similar to how LSPs are already separated from most editors. One step less hardcore than writing a whole editor. Anyone know of any existing pr…

You can already do this in vim. Pretty easy to shell out to whatever command you want and use the result for various purposes.

That's still built on top of the hardcoded vim design choices though.

For example, I really like the "select then edit" approach of Helix, but Vim doesn't really play nice with that (there may be better plugins since I last looked to be fair). File handling, buffer rendering, and frames have very little to do with that, and yet I have to switch editors, lose all my plugins and configurations, and switch all those subsystems at once.

There's missed opportunities for modularization.

Edit: looks like Neovim is already split from its UI.

Post reply on HN