Live data from Hacker News

Lite XL: A lightweight text editor written in C and Lua

lite-xl.com

51–60 of 151 posts

Re: Lite XL: A lightweight text editor written in C and Lua

#51
post #27

Earlier quoted context omitted.

Last time I looked it was simple software rendering on an SDL windows. As simple as it goes. I was impressed by how fast it was given that software rendering should be quite slow, but these days CPU are so powerful that this might not be a problem A simple OpenGL renderer could be added with minimal efforts I think.

But if OpenGL was used, wouldn't that have to go through Zink and MoltenVK for Apple? Or is there a Zink-like OpenGL wrapper for Metal?

SDL will let you push geometry directly without needing OpenGL now with its geometry API, and I think all of its drawing functions use that by default now. I don't know if that's adequate compared to OpenGL but it isn't entirely CPU bound. Dear ImGUI's SDL renderer uses it.

Re: Lite XL: A lightweight text editor written in C and Lua

#52
post #37

I've wanted to write a small text editor for a while - cause I feel like most editors don't fit my workflow - but I've been a bit too busy with work. I don't really care about fancy features or extensions. Let me just create "tasks" (for compiling and such) and let me execute these tasks with a single button, then let me see the output from these tasks that eventually execute some application/compiler etc. That'll le…

Also been thinking this.

What I want from a text editor is:

- Like you said, running tasks with a button/keybind, easily customizable (Like I wanna open a config file, add a function/script, bind to key/create UI button, done, not make a "plugin" not compile an "extension" or anything like that)

- Fuzzy finding/search - ripgrep and fzf can do that, so just bundle those I guess, or write my implementation of those.

- Must start instantly, load files instantly, every action needs to takes at most 100 ms.

- Be a "portable application", i.e it sits in a folder with everything it needs and I can copy that folder to any computer and be up and running with exactly the same configuration.

and NOTHING else.

Re: Lite XL: A lightweight text editor written in C and Lua

#53

What GUI Library does the editor use?

Last time I looked it was simple software rendering on an SDL windows. As simple as it goes. I was impressed by how fast it was given that software rendering should be quite slow, but these days CPU are so powerful that this might not be a problem A simple OpenGL renderer could be added with minimal efforts I think.

It's a bit more complicated to add the OpenGL renderer, because of subpixel font rendering. You need to sample the framebuffer to do it correctly in all cases, as well as a custom shader. It's on the list of things to do, but as you say, CPUs are generally powerful enough these days; so it's not super high-priority at the moment.

Re: Lite XL: A lightweight text editor written in C and Lua

#54
post #37

I've wanted to write a small text editor for a while - cause I feel like most editors don't fit my workflow - but I've been a bit too busy with work. I don't really care about fancy features or extensions. Let me just create "tasks" (for compiling and such) and let me execute these tasks with a single button, then let me see the output from these tasks that eventually execute some application/compiler etc. That'll le…

I actually authored something for this to work with my workflow on lite-xl (I compile a mid-sized C++ codebase on the regular).

It's still not really ready for release, but it's here, in case you're at all interested: https://github.com/adamharrison/lite-xl-ide ; it's a build system and debugger integration.

The build tasks don't run in a terminal however; they move over to a build window at the bottom of the editor. The execution, however, by default, runs in whatever terminal you want to configure, so the actual program output does dump to an external terminal. Unfortunately, there is no truly integrated terminal as of yet.

Re: Lite XL: A lightweight text editor written in C and Lua

#55
post #46

Earlier quoted context omitted.

Yes; F10 enables word wrap. It's a plugin included in the core.

Thanks a lot! Edit: just tried it, it works. But unfortunately it only wraps on character, so it won't work for me now. As a writer I was looking for something more lightweight than VS code, and Lite XL looks promising. I'll keep an eye on it.

This is configurable. I use it in my android fork that I use for creative writing, `write-xl` (in case you're interested, here: https://github.com/adamharrison/write-xl ; not really ready for public consumption). You can set the word wrapping configuration via your user plugin by doing:

config.plugins.linewrapping.mode = "word"

The full list of options is here: https://github.com/lite-xl/lite-xl/blob/master/data/plugins/...

Re: Lite XL: A lightweight text editor written in C and Lua

#56
post #31

Can someone suggest an editor for macOS with smart text algorithms to allow work on unlimited file size or line length? I need to view unlimited text, switch between encodings (including hex) and I want editor with proper algorithms, so it'll work instantly and without loading entire file in the memory. Should support search with fast regex engine. Editing would be nice too. I imagine editing as a sequence of actions…

I would suggest to post your question as a „ask hn“. More people would see your questions this way

I would like that too. I'm sure lots of posters will have excellent suggestions.

Re: Lite XL: A lightweight text editor written in C and Lua

#57
post #41
post #39

Earlier quoted context omitted.

That is a method I've been toying with. But it's still such as hassle to quickly prototype something this way. It's also near impossible to get I J K L working as the cursor keys in VIM without having some major interference.

Maybe you’d have more success with Emacs? You could write elisp functions for your tasks and bind them to your prefered keys, with or without Evil.

Actually, using Org mode and the Hyperbole package in Emacs solves all the problems listed in easy to use ways except you get much more editing dunctionality rather than just the features requested. Don’t reinvent the wheel; just learn something that runs everywhere and solves your problems. You start Emacs once and then rapidly edit files from the command-line by calling emacsclient, not restarting Emacs.

Re: Lite XL: A lightweight text editor written in C and Lua

#58
post #13

I use this on an ancient Chromebook because VSCode and Lapce feel sluggish in comparison. What it really needs is a plugin manager.

We actually do have one, about to be released: https://github.com/adamharrison/lite-xl-plugin-manager

Comes with a plugin to provide a gui in lite-xl. Once this gets to 1.0, we'll probably start bundling it with the `addons` release.

Re: Lite XL: A lightweight text editor written in C and Lua

#60
post #25

Uses SDL for rendering the UI. While it makes it work cross-platform it unfortunately means it won't look like a native application. Then again, I don't think there's a C library which provides cross-platform native UI, only the Lazarus toolkit for Free Pascal and WxWidgets for C++.

"Native" means compiled code (likely C/C++/Rust/Zig) for some. And it means using platform-specific UI widget for others.

I don't care too much about the UI widget style as long as the implementation is good and responsive. I tend to use app in fullscreen (F11) with minimal chrome and to be honest I kind of like when each app has its own UI style, especially if it can be user-configured with themes.

Apple/macOS users tend to fall in the other category, following the Apple guidance, where all apps should look like they were made by the same company.

Post reply on HN