Path: utzoo!attcan!uunet!mcsun!cernvax!chx400!ethz!ethz-inf!wyle From: wyle@inf.ethz.ch (Mitchell Wyle) Newsgroups: comp.editors Subject: Re: fill-paragraph in VI? Message-ID: <16596@ethz-inf.UUCP> Date: 22 Mar 90 16:10:13 GMT References: Organization: ETH Zurich Lines: 30 In article kz08+@andrew.cmu.edu (Ken Zuroski) writes: >I taught myself VI. It's pretty neat! But one thing I miss: the equivalent >of an emacs "fill-paragraph" command, which I use quite frequently when I'm >doing a lot of editing and messing my margins up. I don't see any mention >of a VI "fill-paragraph" in the manual; any solution other than to pipe the >doc through nroff (which I won't do, 'cause it's too time consuming)? Is >there a way to build a macro to do this? There is the macro: map @ {j!}fmt^V^M}be which forks a shell and uses Unix fmt(1) to fill your paragraph. As you say, it is slow to fork a shell. Then there is this bizarre thingy: map F jf k0J72^V|EBr map @ {jFFFFFFFFFFFFFFFFFFFFF which depends on the "f k" to fail at the end of a paragraph (blank line). It is a bit faster but I prefer the former (fork a subshell) which is more robust. They keep upgrading our hardware, and the vendors keep coming up with more clever software. On a sparcstation-1 Sun-OS 4.0.3, if you !}fmt in vi frequently, it gets faster and faster until it is just as fast as the second, all-vi macro above. The OS seems to second-guess what you're going to do...