Path: utzoo!attcan!uunet!microsoft!steveha From: steveha@microsoft.UUCP (Steve HASTINGS) Newsgroups: comp.editors Subject: Re: fill-paragraph in VI? Summary: Pipe through fmt Message-ID: <53708@microsoft.UUCP> Date: 22 Mar 90 19:00:12 GMT References: Reply-To: steveha@microsoft.UUCP (Steve HASTINGS) Organization: Microsoft Corp., Redmond WA Lines: 18 The traditional way to fill paragraphs is to pipe the paragraph through the fmt program. The pipe command in vi works like the delete command: you type the command to invoke it, and then you specify what it should work on. Just as "d}" will delete the rest of the current paragraph, "!}" will pipe the rest of the paragraph through a command. You will be prompted for the command to use; type "fmt" and watch your paragraph fill. Note that the "}" command wants nroff/troff commands to figure out where the paragraph ends, but a blank line will also indicate the end of a paragraph so you can still use this on simple text files. If you don't have fmt, you can write a simple program to do the same thing. It should read the standard input and write the standard output. The pipe feature of vi is one of my favorites. I often use "!Gsort" to order a list in a file.