Live data from Hacker News

Writing my own text editor, and daily-driving it

blog.jsbarretto.com

51–60 of 124 posts

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

#51

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 used Kate a note taking app synced with syncthing for a while. Using only md files. I had another md based app on Android that worked similarly.

Kate has a decent file browser for hierarchy and it'll stay in place and not return to a weird default path when you close it. And as you said, very fast to open and use.

For one off Notepad like things I like Mousepad especially because it has the Notepad++ feature of being able to save a session without asking you whether it should. Featherpad is also nice for this kind of use.

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

#52
post #50

It's so fascinating how different things people look for in such a simple thing as a text editor. A file browser? Terminal?

Indeed, all I need is something that connect to a running background repl so I can evaluate code, everything else basically bells and whistles. Others seem to run entire OSes as their editor.

I'm glad we have so many options, and it seems like each year we have even more options :)

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

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

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

#54

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 know this is just one data point, but I don't notice any latency when typing code in VS Code. It takes a while to start up, and that is annoying especially for quick short editing jobs, but other than that I never notice any sluggishness. Is this something many people experience?

Project size is obviously going to be a factor, but so is machine specs. It's much more noticeable on a spinning disk. One can partially compensate for the project size aspect by opening vscode as far into your project as possible (eg, the api subfolder) rather than at the root. No real solution if you don't have an ssd though.

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

#55

Fond memory of when I wrote an editor in the 90's because we didn't want to use "ms edit" for COBOL and asm files. Syntax coloring, fast buffering and even a screen saver. You could even call the compiler directly from it. All this running on a pentium 120 and it felt a thousands times faster than today's vscode. But vscode can edit multiple files at the same time...

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 Binary
      Repeat a string n amount of times
      Windows Explorer-like file view (docked window)
      Unlimited file history
      Favorite groups and files
      Unlimited private clipboard for each open document
      Associate file types to be opened with this editor
      Split the view of a document up to 4 ways
      Code Complete (ie. IntelliSense)
      Windows XP theme support
    
Back then we used uppercase HTML tags.

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

#56
Any chance people in this thread have some recommendations for text-editing libraries? I would love to build my own text editor, to do some things in my own way that no one else seems to have an interest in doing, but one of the big things for me is that it must be a GUI. I won't bore people with the reasons, but that requirement forces me to bring along a lot of stuff, like a font renderer (at least one) and a graphics context.

To do all of that and write a text editing library at the same time is a little more than my nights and weekends can handle. If I start on just the text editor, it'll only work in a terminal console, so I won't actually use it for my own projects. If I start on just the GUI, I won't actually use it because it won't actually work. So, even if I'm going to replace the text editing library at the heart of the project with custom code, eventually, it's pretty much a non-starter if I don't have something to use to get started.

To be honest, I'm kind of surprised to have so much trouble finding a solution here. Everything I find is either a self-contained text editor, or a full-on "mission statement" GUI (development can be easier/better by using our editor's features). I've had a very hard time finding something that is just an API that I can feed input and have it return me reasonable state updates about the text content. CRDTs or whatever.

I'm assuming people just figure you're either going to write a toy text editor, in which case simple text editing will work, or you're going to write a full-blown showcase product, in which case your advanced structural design with performance-focused editing, language servers, multi-cursor support, etc, will be your selling point and functional focus. But that seems to leave this surprising hole where a developer who wanted to "rebuild windows' Notepad app, except that it can handle text files with massive lines without slowing way down" would have to actually implement the advanced text editing line management rather than just use a library for this well-solved problem.

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

#57
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)

I am sure that people who use KDE can politely respond to your critique but I can say this that I used to use Kate for sometime and its really great.

Fun fact but Asahi Linux creator uses kate :)

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

#58

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.

Kate is great but as others have said. Zed is great too. My combination of text editors is probably zed when I need Gui and Micro editor when I need terminal. Both have great user experience

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

#59

Any chance people in this thread have some recommendations for text-editing libraries? I would love to build my own text editor, to do some things in my own way that no one else seems to have an interest in doing, but one of the big things for me is that it must be a GUI. I won't bore people with the reasons, but that requirement forces me to bring along a lot of stuff, like a font renderer (at least one) and a graph…

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.
Post reply on HN