The Acme User Interface for Programmers

Jan 29, 2019 06:35 · 767 words · 4 minute read Acme Editors Tools UI Plan9

I’ve been thinking about writing this for a while, so I’m going to stop thinking about it and write it.

What is Acme

Acme is described on its official site as “a powerful text editor, development environment and textual-user-interface platform.” It is a fair description, although by today’s standards it might look a bit lacking. It was originally developed by Rob Pike for the Plan9 research operating system at Bell Labs.

What does it look like, even?

Acme

Configuration

Almost nothing.

Start acme with the -a flag so that when you press , you’ll get the same indentation as the line you just were on.

Start acme with -f to pass a font to your liking (as long as it’s somewhere in the font server (we’ll get to that)).

Colors? You have a choice of pale yellow for the windows, and pale blue for the tags. Wanna change that out? Recompile the program with the correct constants. Also probably don’t do that, the colors are supposed to be easy on your eyeballs.

Oh also there’s no syntax highlighting. Text is black. Have fun.

WAIT WHAT?

Yeah you don’t miss it as much as you’d think. You’ll miss things like code completion, intellisense, things of the like much more than syntax highlighting. I’d have to say, about a year in, what I missed the most was tab completion. Especially when you open up a shell window within the editor, where you don’t even have tab completion of commands. The mouse-centricity might also annoy you a bit, especially if you take pride on keeping your fingers on the home row and never using your pointing device.

<shocked silence>

¯\(ツ)/¯ I’m not trying to sell it to you.

Features

(Yeah, there’s features)

Code completion

Like a lot of things that come or inherit from Plan9, Acme exposes a virtual filesystem, allowing you to interact with it through your system. Creating windows, closing windows, saving, manipulating content of buffers, you name it, it’s all there. In my case, this even means that I have code completion because someone was kind enough to implement a Language Server Protocol client for Acme. This means, in effect, that I have most of the niceties available to more popular editors like vscode, atom or sublimetext. This is all achieved through interaction with the virtual filesystem by the LSP client.

Tight integration with your local system

You can type everywhere in Acme, both in windows and tags (respectively, the yellow and blue parts). Selected text can be used as a parameter for a command, piped as the input for a command, replaced by the output of a command. Selected text can also be executed as a command.

Very mouse-y.

You’ll want the mouse for everything. Essentially. If you double-click directly on the inside of a parenthesis or bracket (squiggly or square), Acme will select up to the matching character. Yes, that includes further opening and closing characters.

Middle-clicking a word will try to execute it as a command. Middle-clicking a selection will try to execute the selection.

Then there’s mouse chording, but I’ll do a follow-up article on that. Chording is awesome.

You’ll get used to it. If you decide to use it. I’m not getting money off of this or anything. Have you seen this bloog? Ad-free, this bloog. It is my bloog. There are many like it, but this one is mine.

THE PLUMBER (insert many impressive emojis here)

When you right click anything in Acme, the default action is to search for the next exact instance of that thing. This allows you to circulate fast to the interesting bits of your current file. BUT! If you run a smart little program called plumber (that comes with plan9port), Acme will FIRST pass it through to that program through its virtual filesystem (is my understanding of it, and that’s probably technically wrong, but it’s easy to reason about it that way for me so that is what I do).

The plumber takes in rules to match against and then has actions to execute in response if there’s a match. Therefore, for free, if I right-click a URL, it opens the browser. If I right-click an image, it plops it open on my screen.

I even added in custom rules so that it pops a new window in Acme when I right-click a thing that looks like a Jira ticket ID.

The cool thing is that the plumber works stand-alone too, you can just plumb path/to/a/file and the plumber will try to match it.

There’s other stuff

But this post is already long. There’ll be follow-up articles.