Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!ames!oliveb!intelca!mipos3!omepd!pcm From: pcm@iwarpo3.intel.com (Phil C. Miller) Newsgroups: comp.editors Subject: Re: Reformatting in vi Message-ID: <2736@omepd> Date: 22 Jan 88 00:44:40 GMT References: <1988Jan19.102343.3255@nonvon.uucp> Sender: news@omepd Reply-To: pcm@iwarpo3.UUCP (Phil C. Miller) Distribution: na Organization: Intel Corp., Hillsboro Lines: 24 In article <1988Jan19.102343.3255@nonvon.uucp> cfj@nonvon.UUCP (Charlie Judson) writes: > >When editing with vi is there a "paragraph reform" capability similar to >Control-b in Wordstar? In vi there is a mechanism for passing paragraphs to a simple text formatter called fmt. This utility simply does a 'fill' operation; that is, adds text on a line until the line is full, then start the next line, etc. This mechanism, when used in conjunction with with the J(oin) command, provides a rudimentary capability which will do what you want. You invoke this mechanism by typing: !}fmt This can be interpreted as follows: ! escapes the editor and invokes a Unix shell; } indicates a paragraph-level entity is to be passed as standard input to the shell command; fmt is the shell command to which the paragraph is to be passed, and which does the reformatting. Vi somehow magically substitutes the new, reformatted text for the old, unformatted text in your edit file. > Charles Judson ...!ptsfa!nonvon!cfj