Yes, vi can reformat a paragraph without using !child.
Blair P. Houghton
bph at buengc.BU.EDU
Wed Jun 21 07:41:35 AEST 1989
In article <317 at oha.UUCP> tony at oha.UUCP writes:
>The following macro binding, added to your .exrc, joins the current line with
>the next line, moves to column 78, backs up to the previous word break, and
>splits the line there, leaving the cursor on the next line. Repeat the
>keystroke until the paragraph is cleaned up. Note that ^X is used to
>indicate a real control-X, and you'll have to type some extra ^Vs to get the
>control characters into your .exrc, and pick the key you want to map (F1 is
>shown in this definition)...
>
> map #1 J78^V|EB^Hr^V^M
It works in a limited manner. For instance, if the line is the last line
of the file, the J will fail, and the command will abort. If the entire
line is contiguous nonwhite characters the B will place the cursor in the
first column, wherupon the ^H will fail, aborting the command.
I like it, though, primarily because it uses the | in a map, which I
used to think was impossible.
--Blair
"But then, I used to think
that proving Fermat's Last
Theorem was impossible..."
More information about the Comp.unix.questions
mailing list