How did people use ed?
retrocomputing.stackexchange.com
retrocomputing.stackexchange.com
Homepage: http://sam.cat-v.org/
Paper by Rob Pike: http://doc.cat-v.org/plan_9/4th_edition/papers/sam/
And another paper by Pike on sam's command language (at the core of which are what he calls 'structural regular expressions'): http://doc.cat-v.org/bell_labs/sam_lang_tutorial/sam_tut.pdf
Sam alone, however, can be compiled for command line only, without X11 support under Linux. This has been done in the 9base package:
https://git.suckless.org/9base/file/sam/Makefile.html
https://tools.suckless.org/9base/
There is also an updated Linux version of Sam alone, without any other P9 tools. I suppose this should also be trivial to build without X11 support:
The discussion of this GUI dependency came up years ago on HN and someone who worked at Bell Labs now at Google basically said, in so many words, "sam without the mouse is not sam".
A link to that discussion would be great (if you manage to find it).
https://news.ycombinator.com/item?id=4120513
And a cheat sheet linked there:
I use the list command to dump out sections of the program until I find where I want to edit and then add / edit lines whilst I can still see the listing at the top of the screen.
Source: DBA.