Hello Paul,

> I do context constrained global edits in ed with the following technique:
>
> 1) identify a character that does NOT appear in the first column of any line 
> (so far the character '@' usually works)
> 2) mark the lines I want to make the global edit on by inserting that 
> character at the start of each such line
> 3) globally make the edit on each line starting with that character
> 4) remove that leading character (one more global edit).

This is not enough, because it’s still single-line-restricted and
non-interactive. The “context” I’m talking about is:

- Line number (n)
- Preceding lines
- Following lines
- Special characters (l)

I specifically mention G (capital g) here, because I believe it to suit
this context-aware editing better. And that’s why I’m asking about
printing suffixes for G—these sound just right for the job.

> When I prefer such context as the default, I break down and use
> whatever "screen" editor I am using that decade.  The "ed" editor
> is inherently a line editor, which with such techniques as above
> enables me to show _just_ the lines I want to show.  Sometimes
> that works best, sometimes not.

A shame, ed(1) is a good editor begging to be explored and mastered.

Best of love,
-- 
Artyom Bologov
https://aartaka.me

Reply via email to