In ed
there is the useful c
command which allows one to make changes to a specific line. (Using rlwrap
as well allows for easier changes, once a line has already been changed, because one can use the up and down arrows to introduce a previous change.)
One feature that would make such changes a lot easier would be for ed
to copy the line to be changed without the need to retype all or most of it again, and one could simply use the back arrow to make whatever changes are required, without having to use the mouse to copy and paste the line to edited.
For example:
1 This line must be changed
c
This line must be changed
Rather than this, which is the default behavior:
1 This line must be changed
c
BLANK LINE
I am not sure if this is at all possible using a program outside of ed
?
ed
for all my editing tasks, and would like to avoid going in the direction of something else, but I do understand what you mean. – Edman Jul 06 '22 at 15:24rlwrap
would allow you to do editing history recall, but it's not exactly what you have asked for. You would typec
followed byCtrl+R
and whatever you're searching for, orEsc-/
if your readline is in Vi mode. – Kusalananda Jul 12 '22 at 18:03