Reflections on using Acme
2020-01-15
I've been using the Acme text editor for over 4 years now. I thought it might be fun to reflect on it a bit.
Plan9port not Acme
It sounds simpler to say I use Acme, but I'm really using plan9port. Plan9port is a graft of parts of the Plan 9 operating system that lets you enjoy a part of the Plan 9 experience without actually running Plan 9 on your computer. Nowadays there are ways to run Plan 9 but it's more for enthusiasts than for doing your daily job, I think.
So I'm using plan9port which is a graft of Plan 9 onto (in my case) macOS and Linux. And for me the centerpiece of this is Acme.
What is Acme
Acme is a minimal but powerful text editor. When I say "text editor" I mean an editor for programming, not a word processor.
Things that make it minimal: all text is monochrome. The color theme is fixed (to something similar to "solarized light"). There is no way to show line numbers in your file. There are very few keyboard short cuts and you cannot customize them. The list goes on.
Things that make it powerful: the built in editing language that lets you write sed-like commands to modify text in windows. The text-based file-like API for modifying windows and their contents programmatically, if you want to. Smooth integration between the text in your windows and Unix-style filter commands.
I am writing this note in Acme. Right now I have a bunch of paragraphs
that are on one line and I want to line-wrap them. To do this I write
an editor command: Edit ,|fmt
. Now I select that text with my mouse
and I middle-click it (Alt-click on my Macbook).
After the middle-click the text in the window has been replaced by a wrapped copy of itself.
It feels like shell scripting but I'm inside a text editor.
Acme as a terminal emulator
Before I started using Acme I was already a fan of programming using a relatively "dumb" text editor combined with a Unix shell in a terminal emulator. The usual alternative is to use an Integrated Development Environment.
Because Acme is so minimal it is very much a "dumb text editor" so you
need a terminal to go with it. Fortunately it comes with one: win
.
Win is a program that sits between an Acme window and a shell. When I
type into a win
window and press enter, the line I wrote gets fed to
standard input of the shell. The output of the shell gets rendered in
the Acme window.
This makes for a very different terminal experience compared to macOS
Terminal.app or Linux xterm. You can't use ncurses-based applications
or anything that expects to run in a proper terminal. For example if I
run vim
in an Acme win
window it prints garbage and it's unusable.
Another important difference is that a win
terminal does not support
ANSI color codes. After all all text in Acme is monochrome. This means
that whenever a program tries to create colored terminal output I see
ANSI garbage: non-printable characters combined with [
and numbers.
This is all quite spartan and I make all sorts of efforts with helper shell scripts and shell functions to disable and suppress colored output where I can. But the reward is a terminal that integrates very very well into the editor.
Tags: acme