💾 Archived View for tilde.team › ~aprilnightk › gemlog › 2021 › 11 › 24-making_my_ide.gmi captured on 2022-07-16 at 14:35:03. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-03-01)
-=-=-=-=-=-=-
A project that took a lot of my time recently was... creating my own IDE!
Well, that may sound a little bit pretentious, because "IDE" is kind of a stretch. I'm just making a plaintext editor tailored for my needs, and since my needs includes "coding" and "writing gemini pages" - it naturally follows these.
IDE's and text editors are abundant, but whatever I used - I was never satisfied.
These are the editors I used for extended periods of time:
I'm mainly a Python developer, so I've also tried PyCharm, but it was SO slow and bloated that I quickly threw it out. Don't get me wrong, I believe some people find it handy. But I used to like things that don't emulate whole operating systems. There's too much in PyCharm, and it feels slow, and for me that's important: I use a pretty old laptop and I'm not going to switch until it's completely dead, and at the same time - I like my software snappy. So it needs to be lightweight. This is why I use a non-bloated Linux distro and a tiling window manager QTile (to which I switched just last week, I previously used XMonad and it's equally as cool, just written for a language that's foreign to me).
Editors I tried lacked one or several of the following characteristics:
I think the last one was also the final straw. I don't know why, but neither GVim nor KDevelop can open files in separate windows without spawning a whole separate instance (which also makes them unable to interact between each other).
So one day I thought - hey, I love creating bicycles anyway - why don't I just indulge in doing it again now that it can actually be handy?
So I started making my own text editor.
I called it Wahrtype (from german "wahrheit" - "true/right" and "type" - well, type).
Just for the record, other names were considered, such as:
Baically, I wanted a modal editor like Vim, but without all the design shortcomings which really prevented me from using Vim or Gvim as my daily driver.
Disclaimer: I'm not saying that Vim is bad! It's awesome! And I understand why it's designed the way it is. So I just took ideas from Vim that I found worthy, such as the modal architecture, and started to build on top of it.
The only GUI toolkit I know well is Qt, and the only language I know well is Python, so I write it using PySide. I know, doesn't sound too snappy, but where my instrument lacks in speed, I will compensate by only including things that's needed.
This is what it looks like so far.
Wahrtype is driven by plugins, which are *.py files of a certain structure, functions from which can influence the behavior of the program.
Structurally, typical session of Wahrtype includes several windows (none of which are main, there's just no such thing as a "main window" - they are all created equal).
These windows can open text buffers (which can be shared, like in Vim, you can open a buffer in several windows and they will update). Obviously, you can move windows to other screens. And since I'm using a tiling VM, I just delegate window management to it (thankfully I didn't go the Vim way here!)
There are also configurable colorschemes (the screenshot shows the default color scheme).
There are different types of buffers (so-called "buffer roles"), and new ones can be created using the plugin architecture.
So far, there are:
I have three distinct modes:
In Command mode, a special console opens at the bottom of the window (which is otherwise hidden), that contains results for the commands you execute).
For tweak mode, I created a plugin that emulates rudimentary Vimlike navigation.
Wahrtype can be operated both via keyboard and mouse. Each window and each buffer have their unique 3-symbol UIDs, so you can do things like "b jc6" in command mode to open a buffer named jc6 in current window. You can navigate file systems with "cd" and "ls", spawn processes in current folder with commands like "osexec pcmanfm", etc etc.
Modes are switchable using F1, F2 and F3 (insert, tweak and command modes).
With mouse, though, you can make use of the top 4 buttons which correspond to the last four buffers opened in this window (or globally). Older ones can be accessed with a small arrow button to the right.
You can switch modes with mouse too, using the middle button (any acme text editor fans here?)
But what really comes handy is the project manager. You can create projects, which essentially consist of folders (project roots) which you use in this project. For example, you can have a project with your program dev folder, and folders of libraries it uses, and folders of resources it uses.
You then open the project in a special project manager buffer, and you can navigate your folders using both mouse and keyboard, and open the files in your windows. All of this provides for an experience that I, as of now, find enjoyable.
I'm not releasing this editor to public so far, because I'm not really sure it's ready for that, and I'm not sure if anyone needs it. Maybe, when it gets ripe enough, I'll have courage to publish it. You can always drop me a line if you're interested in trying it out.
Thanks for your attention.