Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!cernvax!ethz!ethz-inf!wyle From: wyle@inf.ethz.ch (Mitchell Wyle) Newsgroups: comp.editors Subject: Re: Yes, vi can reformat a paragraph without using !child. Message-ID: <284@ethz-inf.UUCP> Date: 28 Jun 89 14:48:44 GMT References: <317@oha.UUCP> <2783@solo8.cs.vu.nl> <1684@aplcen.apl.jhu.edu> Reply-To: wyle@ethz.UUCP (Mitchell Wyle) Organization: Departement fuer Informatik, ETH Zuerich Lines: 25 >But it's not too much harder to expand on Mr. Olekshy's macro to make it >call itself recursively until the end of a paragraph is reached. >Perhaps adding a "+f k" will work to abort the macro when the next line >doesn't contain more than one word (but I haven't tried it...) I have; the recursion is endless. If you really MUST stay in vi (not fork a subshell) to format your paragraph, one ugly solution to the problem is: map ^XF jf k0J72^V|EB^Hr^V^M map F {j^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF^XF Or put as many control-X F's in your format-paragraph macro as you want. I usually don't format paragraphs longer than 20 lines, though. This solution is much faster than forking a sub-shell, but an ugly hack. I looked for that weird turing-machine in vi macro language, but couldn't find it. Was it archived anywhere? Did Brandon post it in .sources.misc? Anyone want to re-post it or send it to me? Cheers y'all, -Mitch -- -Mitchell F. Wyle Institut fuer Informationssysteme wyle@inf.ethz.ch ETH Zentrum / 8092 Zurich, Switzerland +41 1 256 5237