leah blogs: September 2010

26sep2010 · The week of ed

“yeah, I’ve seen editors like that, but I don’t feel a need for them, I don’t want to see the state of the file when I’m editing” —ken

This week, I did an experiment: For a whole week, I used ed(1) as my primary editor. No vi/vim, no emacs for editing. (I’ll keep using Gnus for reading mail and news, but not for writing anything significant.)

% 9 ed ~/.zshrc
a
# during the week of ed, 20sep2010  +chris+
alias vi="9 ed"
alias vim="9 ed"
# hah
export VISUAL="9 ed"
.
wq

Now, one may ask how to hit on such a stupid idea. Well, I wondered, most parts of classic Unix were written in ed, and its core people used it for a rather long time afterwards (that is, until sam gained traction).

So it can’t be that bad, can it? Oh how wrong I was.

I decided to use Plan 9 ed, mostly because it perhaps is the most modern implementation of ed (e.g. featuring UTF-8 and libregexp), and the most truthful, being derived from Research Unix probably back to the original ed. No watered down GNU ed with their own quirky extensions, the real good stuff.

Turns out Plan 9 ed can’t even pipe things to processes or read from them, which made formatting text a pretty big PITA.

Else, I mostly coped with it. One tends to think a lot more before typing. And the interface is fantastic for editing .ssh/known_hosts. :) I’ll probably continue to use it for really small, well defined editing tasks. Having the backlog of the terminal in sight when editing shouldn’t be underestimated.

% 9 ed ~/.zshrc
/week of ed/,$d
wq

It was an interesting experiment, but I realize now how hard it is to use a line editor (if I ever went blind, I think I’d use edbrowse). Perhaps I’ll do a “week of sam” or something like that in the future.

NP: The Brian Jonestown Massacre—Wisdom

Copyright © 2004–2022