aretext 1.0 release

After nearly three years of development, aretext has reached version 1.0! Aretext is a minimalist terminal-based text editor with vim-compatible key bindings.

In this post, I’ll present the main changes since the last version, reflect on the journey from initial idea to 1.0, and discuss the future of the project.

New syntax languages

Syntax highlighting is now available for bash shell scripts and XML! These also work well for related languages like POSIX shell and HTML.

Screenshot of aretext with bash syntax highlighting

In total, aretext now supports syntax highlighting for 15 languages, all of which are implemented in pure Go.

Bracketed paste

In previous versions, aretext would interpret pasted text as individual key presses. In insert mode, each character would be inserted into the document one-at-a-time, which was relatively slow. Worse, when pasting in normal mode, aretext would interpret the input text as commands, which could cause unexpected results like deleting text or exiting the program.

Bracketed paste is a terminal emulator feature that allows applications to distinguish pasted text from normal key presses. With version 1.0, aretext now recognizes the “start paste” and “end paste” events sent by the terminal emulator. This allows text to be pasted into a document much more efficiently and prevents misinterpretation of input text as commands.

Vim commands for editing blocks of text

Many more vim commands have been added to manipulate “blocks” of text. Some examples:

The full list of available vim commands can be found in the command reference section of the aretext documentation.

Reflecting on three years of development

The first commit in the aretext git repository is dated June 1st, 2020. Three months into a global pandemic and a new job, working from home. The daycare was closed. I remember sitting under the redwood trees in the park by my apartment with a legal pad, scribbling ideas for an open-source project. I thought a vim clone would take maybe six months to build.

Eight months later, my family vacationed at a farm house in Ojai. Between picking oranges, feeding chickens and cows, and playing with my daughter, I worked on the editor. By the middle of the week, I had finally implemented enough functionality to switch from vim. From that point on, I developed aretext using aretext.

I have a video of my daughter, two years old, sitting at my desk pressing the keyboard and filling the terminal screen with thousands of “D"s. She still occasionally asks “Can I do so many D’s?” when she wants to play with the editor. I have a photo of myself the morning of my birthday two years ago, sitting in an armchair wearing sweatpants with a research paper about parsing on my lap.

I’m still not quite sure why this project held my attention for so long, but I’m grateful that it did.

Future direction of the project

So what’s next? I plan to continue maintaining aretext indefinitely. (I need to because it’s my primary editor, and I use it every day!) However, future releases will focus more on stability, performance, and other incremental improvements over new functionality.

One of my goals in designing aretext was to build something that could last for decades. That’s why aretext has so few dependencies, only two of which are indispensable: tcell and the Go standard library. It’s also why aretext is a minimalist text editor. I believe a small number of carefully chosen features can be maintained sustainably long into the future.