wink

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.

#textadept #editors #nih