Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!buengc!bph From: bph@buengc.BU.EDU (Blair P. Houghton) Newsgroups: comp.unix.questions Subject: Re: Yes, vi can reformat a paragraph without using !child. Message-ID: <3249@buengc.BU.EDU> Date: 20 Jun 89 21:41:35 GMT References: <317@oha.UUCP> Reply-To: bph@buengc.bu.edu (Blair P. Houghton) Followup-To: comp.unix.questions Organization: Boston Univ. Col. of Eng. Lines: 23 In article <317@oha.UUCP> tony@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..."