First Impressions Of Acme

I suppose that after learning Go and falling in love with the community around it, it was inevitable that I would find Acme, Rob Pike’s and Russ Cox’s editor of choice, and shamelessly install it like the crazy fan boy I am. And I’m sure glad I did!

Join Me for a Nice Brew

My first pleasant discovery was how easy it was to install this gem. If you’re on a Mac, it’s as easy as brew install plan9port, which actually provides you with all the tools from Plan 9, or so I’ve heard. Since a lot of these tools keep the same name as their Unix cousins, they are “name-spaced” under the 9 command to avoid colliding with your native binaries. Therefore, opening Acme is as simple as 9 acme. Then you might see my first “furrowed brow moment” with the editor: sometimes Acme will load as a blank screen. But I quickly figured out that it fixes itself after resizing the window and this editor is best used at full screen, so no actual UX heart burn there. Also, if you watch the Plan 9 intro video I link at the bottom, you might come to the same conclusion I have: resizing the window has a lot to do with when Acme loads.

Ok, so now I have Acme installed and running on my Mac. What’s next? Well I initially learned a few moves and concepts for Acme from Russ Cox’s intro video, which I also have linked below. Remarkably, the intro video covers a lot about how you interact with Acme in about twenty minutes and it’s all very easy to remember. So my second “wow” moment was how well I could move around and work in Acme compared to the first spartan editor I’ve attempted to learn, with some success, Vim. Acme is much easier to learn than Vim.

The Mouse in the Stone (or uhh… Box)

After watching Russ Cox’s video on Acme, I knew about the suggestion to use a three button mouse. If your scroll wheel clicks (most of them do) this can serve as your middle button if you want to give this editor a test drive. But when I try something, I dive right in and that meant finding a three button mouse somehow, some way, at work. Luckily, we have one of those boxes at work. Yeah. You know what I’m talking about. That box. The one that holds the peripherals your boss’s boss probably used to sling code before you were but a twinkle in your parents’ eyes. In that box, I found a working (important), clean (super important) Sun Microsystems three button mouse. It was soul crushing grey, still used a track ball, but somehow had the most satisfying click I’ve ever experienced. It was simple, it was old, yet oddly pleasant. It matched Acme perfectly.

Indentation, and Fonts, and Scrolling, Oh My!

With my weapon of choice in hand, it was time to take what I had learned from Russ Cox and try to do some work. Unfortunately, this is where we get to a bumpy part in the road for this narrative. Currently, I am on a web project that is mostly HTML and JavaScript. I do not advise trying to edit HTML as your first task in Acme. You see, Acme has no syntax highlighting. It uses a proportional font by default. The TAB key will insert a literal TAB character worth the width of 4 zeros in this proportional font which means if someone used spaces for indentation your TABs won’t line up. The up and down arrow keys scroll the window for God’s sake. I know the programmers who started with Python just heard the word TAB and are recovering from their minor faint, but I have more to say so please get some air and prop up your feet.

Trying to edit that darn HTML file was the most annoying point so far in my journey to learn Acme. I knew I needed to learn more about how to use Acme to get around these pain points, so I went to the internet. First, I found out about the -a flag, which tells Acme to copy the whitespace from the previous line to the next line. This means it will copy any spaces, too, which I didn’t realize at the time. Let’s just say much profanity was used. But then, I found a blog post series by someone who recorded their trial of Acme and two discussions on the 9fans mailing list that helped me both grok and use Acme. Like the other resources, they are linked below.

The Knights Who Say… No!

In the first mailing list discussion, Russ Cox answers a list of questions about how to do a lot of the things other editors can do, in Acme. The answer was mostly “just say no”. I find it amusing that, just like in our actual practice of writing software, we should say no to some of the ideas imposed upon us on how to literally type out our software. In his brief answers, Russ Cox carries a lot of un-emphasized proverbs for interacting with text, so much so that I will have to write about it in a second post.

Wax On…

The second discussion was an amazing share of Edit “scriptlets”. Edit is an Acme command that takes a form of regular expression, very similar to Vim’s :% command, to describe what to substitute for something else in a file. While I had already used Edit a little bit, these scripts allowed me to really broaden my “Edit foo” and do some desperately needed things like replacing 4 spaces with a TAB and moving selected text in or out one TAB. While Vim or Emacs users are probably laughing right now that a regular expression is needed to indent a block of code, I appreciate the simplicity and the application easily scales to powerful transformations.

As Close as a Muggle Can Get

Finally, the blog post series gave me some practical tips, like how Acme can Dump its current set up into a file to be Loaded later. This feature is absolutely amazing. At the end of the day, I can just Dump my window set up, Load it in the morning, and hit the ground running again. No more morning window dragging for me.

Another nifty tip is keeping a scratch file. This is a file you write to disk with all the relevant shell commands you normally execute day to day and when working on a specific project. That way, the text is right there for you to tell Acme to run. Oh yeah, did I fail to mention that part? Every bit of text in Acme can be sent to your shell as a command to be executed. Then any output from that command gets echoed back to an Acme window. Then that text gives you more possible shell commands. It’s a very productive feedback loop and a great experience I believe Emacs users can sympathize with. If you don’t completely understand what I mean, just know I feel like Harry Potter and my mouse is fresh out of Ollivander’s. I’ll leave the explaining to Russ Cox’s intro video, considering he has ten or more years of experience and I’m still over here waving my mouse around like an idiot, trying to learn “Alohomora”.

The Neverending Story…

To summarize, some of the reasons why I wanted to try Acme and why I’m sticking with Acme: I can come into work in the morning, Load my project file, and I’m instantly thrown back into the context I lost overnight. Having the window locations open back up in the same locations they were before really helps me ramp up faster on where I left off. Then, without swapping to a terminal, I can send some commands from Acme to start up my web server or my test suite and start coding. It’s really a tiling window manager meets task manager instead of a text editor, but with zero need for configuration. That’s probably the best feature, the fact that I didn’t need to spend any time configuring Acme to be impressively productive.

And I haven’t even touched on how extensible this truly unique editor is. Maybe in another post.

A Tour of the Acme Editor
Lets Try Acme
Acme Edit scriptlets
Using the Acme Editor
Plan 9 - Thursday Night Tech Talks

comments powered by Disqus