On 2026-02-07 17:51:02 -0600, Tim Chase wrote:
>   $ yes hello | head -50 | fmt -100 > long_lines.txt
>   $ vi long_lines.txt
>   :g/^/.!fmt

        2,$g/^/-!fmt

Gets all but the last line, but a ! prevents any subsequent ex commands
to tidy up the last line, so this isn't a full workaround.

>   $ vi
>   :r !jot 100
>   :g/^/t.

In a similar fasion,

        global /^/ copy -

or the shorter

    g/^/t-

copies to the line before to the current line so that the modifications
do not interfere with the current line. It does leave the cursor on the
penultimate line unlike what the other form might do.

Reply via email to