text editors and word manglers

“The last time somebody said, ‘I find I can write much better with a word processor.’, I replied, ‘They used to say the same thing about drugs.’

— Roy Blount, Jr.

editing lines

The first text editor I ever used was the BASIC shell on our Texas Instruments 99. Granted, editing text was only a side job, but it was still a text editor. (I suppose I could even call it an IDE.) The TI99’s BASIC was a line editor, and it was the only one that I ever used. Unless it is the only feasible way I can perform editing, I will not use line editors. Very few files are structly line-oriented, and even those files can usually better edited if I can see more than one line at once.

I have forgotten almost everything I knew about the next editor I used, kedit. Kedit was a clone of XEDIT, IBM’s default editor on CPM. My father used XEDIT on his office’s mainframes, so he wanted to use something familiar on DOS. Kedit was modal, meaning that there was a mode for typing and a mode for moving around and executing commands. As I was probably only about eight or nine, I wasn’t very interested in commands beyond “open,” “save,” “quit,” and maybe “find.” Apparently, XEDIT and kedit have powerful REXX interpreters built in, along with heaps of other features that keep many programmers addicted, to this very day. (There’s even a GPL clone of XEDIT, THE.)

italics warp my mind

I, too, might have learned to harness the power of REXX (such as it is), had I not been seduced by the evil twin of text editing: word processing. Word processing is one of those terms that is never very clearly defined. I offer the following definition:

word processor: a computer program that combines the least useful aspects of text editing, typesetting, and desktop publishing software with a user interface that prohibits end-users from understanding what they’re doing

A nicely typeset and formatted document is useful because the look of its text provides clues to the significance of the document and its parts. If all definitions are green, they’re easy to pick out. If all chapter headings occur on otherwise empty pages, they’re easy to pick out, too. Humanity has been decorating its text for just about as long as it’s been writing. Word processors are nearly always designed with a focus on letting users directly map formatting to text, without the mediating layer of semantics. It’s up to the end user to remember that definitions are green and headers are bold. Even if you can remember, it becomes a nightmare to change your mind after writing a few hundred pages.

Of course, I was only eight or nine. I probably didn’t know what semantics were, but I did know that it was really cool to be able to print in bold and italics. So, I latched onto my dad’s text editor of choice, Textra. Textra was made by a little company called Ann Arbor Software, and I remember its logo very clearly; the labels on the 5.25” disks on which it was shipped were printed with little Charlie Chaplin-style hats and canes. At some point, my father got into their beta program – that’s how I learned about beta testing – and we always had a new version of Textra. It ran in 80 by 25 text mode, with a status line at the top and bottom, as well as an on-screen display of available keyboard commands, leaving 22 rows for editing. It used color to show you how text had been marked up, but on the tiny CRT in our luggable, everything was shades of green.

I stuck with Textra for years. I used it to write just about everything other than C code until I high school, when I switched to Microsoft Word v2.0, running on Windows. MS Word’s huge advantage was WYSIWYG editing, in which What You See Is What You Get. WYSIWYG made it easier to understand what you really did when you increased the font size on a paragraph or changed the page’s margins. Unfortunately, it didn’t do much to encourage practical semantic markup. The ability was there – Styles – but nobody used it. For the most part, nobody even knew about it. At my office, nearly no one knows about styles in MS Word, and that includes people who use it to perform their primary job functions. Why? I think word processing was based in a culture of ignorance, in which the users were protected from semantic formatting. “Want to write a business letter? Click here!”

Borland saves my soul

At some point when I was pretty young, we acquired a copy of Borland C, which was later replaced with Borland Turbo C. I was probably around ten or eleven. Turbo C included its own IDE, and I used that to write my code. The IDE’s text editor was extremely simple: you could search, replace, move, and edit. It was not modal. I was still using kedit to make modifications to things like AUTOEXEC.BAT, and I know that it seemed to make more sense as an editor than the Borland IDE. Of course, Borland’s editor was so well integrated with the compiler and debugger than I was happy to have it, and used it for all my coding. When I played around with Pascal, I use the Turbo Pascal IDE – it was familiar.

Eventually, MS-DOS 6 shipped, and kedit was replaced with EDIT.COM, which was a serviceable, though mediocre editor. It was much more like Borland than kedit, so I grew comfortable using simple non-modal editors. Under Windows, I used MultiEdit, which was basically just Notepad with multiple windows. Notepad, I will now note, is possibly the most hateful of all text ediors. It was from Notepad that I first learned that Windows was not for programmers.

It wasn’t long after the release of Windows 3 that I stopped writing much code and started running Linux. The default editor under nearly every program in Slackware 3 was vi. In 1995, vi was, in my mind, “the editor that beeps.” I could probably have made most of my programs use something else by changing the EDITOR variable in my login script, but I didn’t know that. So, typically, I would try to, say, send an email and see vi run. I would then spend ten minutes trying to quit before finally suspending and killing vi so that I could get into the program’s options. Pretty soon, jed became my editor of choice.

Jed was a screen editor that acted, at least in its default configuration, a lot like EMACS. It used the S-Lang macro language for extensibility, and had lots of flashy features: syntax highlighting, a clipboard, multiple windows, and so on. It reminded me of the Borland editor, but was much more powerful. I used Jed until shortly after I started college.

BU did not provide Jed on its AIX and SunOS machines. I briefly tried to use EMACS, but the thought of installing megs and megs of Slackware packages just for a text editor appaled me. Anyway, EMACS wasn’t available on all of BU’s systems, either. I chose, and I chose, poorly; I switched to pico. Pico gave me all the interface klunkiness of Textra with none of the features. Sure, it could search, replace, and spell-check, but it didn’t do much more than that. Worse yet, while it was on most of the BU systems, because they had Pine, it wasn’t on quite a few of the other systems I was starting to use. As I got back into programming and system administration, I needed something that was even more common and more powerful. I reverted to vi!

vi: via, lux, veritas

As the first screen-based text editor written, vi (the visual editor), became a standard part of UNIX, and is required for POSIX systems. It’s modal, like kedit, split mostly between “command mode” and “insert mode.” (Also known as “the mode that beeps” and “the mode that doesn’t beep.”) It’s a little hard to learn – remember that it was easier for me to kill the process than to remember how to quit – but once you’ve learned the basic concepts, everything else follows logically. I started with elvis, the vi clone that ships with slackware, but once I tried vim, I was forever converted. Vim is a modern, extended clone of vi, and I’ve used it for about two years.

Most of my job is programming and documenting, and I spend a good amount of time at home doing both as well. I’m actually so used to vim, now, that I find myself hitting ESC in Outlook’s email editor and at my IRC client’s prompt. The former is really annoying, because Outlook thinks I want to abort my message, and asks, “Do you want to save changes?” Naturally, I can’t change my default email editor, unless I want to use Word. Typical!

Written on April 24, 2002