Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpl-opus!hpnmdla!stanj From: stanj@hpnmdla.sr.hp.com (Stan Jaffe) Newsgroups: comp.editors Subject: Re: VI: Positioning the cursor ("|") from within a macro doesn't work. Message-ID: <8000003@hpnmdla.sr.hp.com> Date: 13 Jun 91 18:52:31 GMT References: <1501@cacilj.UUCP> Organization: HP Network Measurements Div, Santa Rosa, CA Lines: 31 How about using the UNIX utility ADJUST? ADJUST is a simple text formatter that allows centering, setting margins, justifying text, etc. You can use it from VI interactively also. If you want to take a paragraph of text and set up the right margin for 72 characters just type: {!}adjust -m72 { moves cursor to the start of the paragraph !} writes out the paragraph to an external utility and replaces text with the output from that utility. adjust the name of the utility -m72 sets the right margin to 72. All line wrapping is done automatically. There are a lot of other nice features in ADJUST. If you run the above and find for some reason it didn't turn out as planned, just type u. (u will undo the adjust command). I have mapped this to a key in my .exrc file. Use control-M for the return key: map ^A {!}adjust -m72 ^M Good luck, Stan Jaffe A.K.A. stanj@sr.hp.com HP Santa Rosa, Calif. "Not responsible for any opinions but my own" ------------------------------------------------------------------