Wrapping text: I used fmt all the time. But you can't pipe text straight through fmt, so I ended up doing this a lot:
3w |fmt>fmt # create a file called fmd in cwd
3r fmt
3d
Which is OK if you have just one line to wrap. If there are newlines in the text you're wrapping, you have to remember the line numbers of the unwrapped text (or use ka, kb) to delete them.
Inserting text in the middle of a line. Either use s// (which is annoying if your inserted text has a lot of slashes) or split the line, add an in between line with the new text, and join.
s/split text/split text\ # <- backslack escapes newline
Then use a or i to insert a line. Then join three lines with j. It gets old after a while.
And then there was my false hope that I learned a universal editor that was everywhere. Except GNU ed is not BSD ed is not OpenBSD ed is not Solaris ed.
Anyhoo, would be fun to read how someone who stuck with it (unlike myself) uses ed.
It's interesting you mention inconsistencies across implementations, even more (I assume) going from BSD to GNU ed which unsurprisingly is almost a superset of features with heretical commands such as yank (!).
BSD tends to stick more to POSIX, so issuing just `t` won't duplicate the current line, which I've grown used to. I also like the paging command `z`, which seems to have been adopted by all major implementations. I'm sure Ken would find all of this bloatware!
Another psychological thing, it's like exiting a room and forgetting what you were supposed to remember in that room. When an editor takes over the whole screen, I feel a little mental context switch that I have to sort of fight (like having to go back into your memory once you leave a room)while ed seems like less of a break in context since it doesn't wipe the screen. That's my feeling at least.
> I don't want to see the state of the file when I'm editing.
In my case at least this is mainly the case for quick edit, though he probably felt this way in general.
A full account by George Coulouris about em, a visual enhancement of ed, is more enlightening:
> By the way, 'em' stands for 'editor for mortals' - I christened it that after Ken Thompson visited our lab at QMC while I was developing it and said something like: "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".
[1] http://web.archive.org/web/20080103071208/http://www.dcs.qmu...