https://orbitalquark.github.io/textadept/ #Textadept #LuaTextEditor #ProgrammingPolygot #ProductivityTools #SoftwareDevelopment #HackerNews #ngated
What happens if you don't read the manual properly?
So I've been using TextAdept as sort of "not as an IDE/Code Editor per se, but a good Text Editor that can also do code" for years (because it's excellent) but I've always been missing VS Code's "Open folder".
So of course I started looking into implementing that but I really couldn't be bothered to dig into the C/C++ code and maybe keep my own fork.
But there's a `~/.textadept/init.lua` and I knew could do a few nice things with its Lua API.
So what I ended up having working:
Run `fd $(dirname current_buffer) | rofi -dmenu -sort -sorting-method fzf && open that file`, but partially in Lua.
But then I discovered "Projects" and also "Quick Open" which kinda does the same, so I now just have a couple lines of code for a function that does `dirname(current buffer's file), provide that editable in a popup dialog (so I can go up), and on submit opens the Quick Open (which has fuzzy search) with that dir as an argument.
And then a shell script to wrap my `fd $1 | rofi ... | xargs textadept` thing for out-of-editor use.
And 90% of it was in the manual. Doh.
Just spent a bunch of time trying to get spellcheck working in #TextAdept because it wasn't clear that you have to go to Releases to get the actual working spellcheck.
For people normally working with compiled software, that probably seems like a "no duh" situation. However, for the rest of us, this was significantly less than obvious.
I challenged myself to implement a code completer for #TextAdept editor in #Lua based on #llama 3.2. It ended up being <100 LOC total.
It feels pretty fast considering that it's running on modest #Arc750. And it's interesting to see the different "code" it makes up every time it's run.
I think its time to get my hands on the user customizable lua based #terminal #texteditor #textadept.
Working with #Linux is so smooth 💖
I love the #TextAdept editor - #Lua based, fast, minimalist, very extensible.
I wanted to write my yesterday's thread and split it up into 500-char chunks.
So I made the following small change to core/ui.lua:
@@ -309,7 +309,8 @@
- local encoding = buffer.encoding or ''
+ local sel = buffer:get_sel_text()
+ local encoding = (buffer.encoding or '') .. (#sel>0 and ' Sel:'..#sel or '')
TADA! Now I just have to select the chunk and immediately see how many bytes I've written...
After years of having to use "real IDEs" and hyper-modded Vim at work, I downloaded #TextAdept again, started it up... and fell in love again. Or is it nostalgia?
There's somethig amazing about the minimalist-but-very-usable, quick, responsive blank slate, which you can customize precisely as you want it.
Diff two files side by side and show the diff in a new view? Few lines of #Lua, `keys['ctrl+alt+D'] = diff` and it's done. GUI and TUI(curses) versions available, gonna be tweaking tonight...
Now that my wayland and pipewire transmissions are done it's time to get #qutebrowser and #textadept set up.
I am stoked. Soon I will have a setup that I can completely integrate into my workflows.
Writing a mastodon reply inside my texteditor on fullscreen? Here we go. Sending websites to my CLI bookmark manager? I am ready. Theming my browser like my OS? Cant wait. So many things possible.