There are  a few good tutorials  on the 'ed' editor  floating around
gopherspace, the one I've most recently seen is from KatolaZ [0][1].
It's  nice and  simple, but  I find  the actual  line editing  a bit
sparse - neither the GNU nor BSD  versions of ed are linked with GNU
readline,  so you  don't have  access  to the  usual arrow,  ctrl-a,
ctrl-e,  alt-d,  etc.  keys.  But  it's  really  easy  to  add  this
functionality, using 'rlwrap', like so:

'rlwrap ed'

Obviously  you might  need to  install  rlwrap, but  it is  packaged
for  many  linux  distros  as  well as  BSDs.  It's  installed  here
on  the  Republic,   and  I  have  a  shell  alias   setup  for  it:
ed='/usr/local/bin/rlwrap /bin/ed'

[0] gopher://r.circumlunar.space/0/%7ekatolaz/phlog/20190505_ed_lists.txt
[1] gopher://r.circumlunar.space/0/%7ekatolaz/phlog/20190830_ed_lists_2.txt