[comp.editors] My vi macros

liberte@uiucdcsm.cs.uiuc.edu (06/08/88)

Below is a macro to break a line at around character 68.  I map it to
"K" to be analogous to "J" which joins two lines.  So I can format
a paragraph with a bunch of "J"s followed by a bunch of "K"s.

But there are a few deficiencies somebody might be able to fix.
It always splits off at least the last word of a line.
It doesnt know about tabs.

setenv EXINIT 'set ai|map K 068lF r

Dan LaLiberte
liberte@cs.uiuc.edu
uiucdcs!liberte

leo@philmds.UUCP (Leo de Wit) (06/22/88)

In article <37200008@uiucdcsm> liberte@uiucdcsm.cs.uiuc.edu writes:
>Below is a macro to break a line at around character 68.  I map it to
>"K" to be analogous to "J" which joins two lines.  So I can format
>a paragraph with a bunch of "J"s followed by a bunch of "K"s.
   [stuff deleted]...

There's another way (that is, if you run BSD): use !}fmt. 
This runs the fmt command on the next paragraph. If you don't have fmt
you could write it in half an hour I think.

    Leo.

txr98@wash08.UUCP (Timothy Reed) (06/24/88)

Try getting the 'ff' source from an archive site, since it will do
all the formatting that 'fmt' will do, plus alot more.  I use that
on my 5.2 systems that don't have fmt.
Timothy Reed

In article <519@philmds.UUCP> leo@philmds.UUCP (L.J.M. de Wit) writes:
>In article <37200008@uiucdcsm> liberte@uiucdcsm.cs.uiuc.edu writes:
>>Below is a macro to break a line at around character 68.  I map it to

>There's another way (that is, if you run BSD): use !}fmt. 
>This runs the fmt command on the next paragraph. If you don't have fmt
>you could write it in half an hour I think.