Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!agate!shelby!unix!hplabs!hpl-opus!steinbac From: steinbac@hpl-opus.hpl.hp.com (Guenter Steinbach) Newsgroups: comp.editors Subject: Re: Vi's (auto-fill-mode) Message-ID: <62420025@hpl-opus.hpl.hp.com> Date: 25 Jan 91 22:01:43 GMT References: <1991Jan24.225511.3375@massey.ac.nz> Organization: HP Labs, High Speed Electronics Dept., Palo Alto, CA Lines: 34 In comp.editors, R.Singh@massey.ac.nz (R. Singh) writes: > This might be a stupid one. How can you get Vi to wrap your sentences around and > insert CR's at the end of each line. I know it is possible to do this literally > but how do you get it to keep the words intact and not cut a sentence in a > middle of a word. For EMACS users, an equivalent of the (auto-text-fill). > Thanx Yeah, looks like you could indeed use that :-) In vi, try: :set wm=4 to set the "wrapmargin". In my vi (HP-UX), whenever wm is set to anything greater than zero, lines get automatically wrapped at word boundaries, at least "wm" characters from the right margin. My normal setting is 8, which is what I wrote this text under. I.e. my .exrc contains set wrapmargin=8 Actually, my .exrc also contains this: " S cycles wm=0/8/4, and tells about it map S *9 map *4 :set wm=4^V|map S *9^M:"wm=4^M map *8 :set wm=8^V|map S *4^M:"wm=8^M map *9 :set wm=0^V|map S *8^M:"wm=0^M which allows me to cycle through wm settings by pressing S. (Those ^caret- thingies are control-V and control-M.) Guenter Steinbach gunter_steinbach@hplabs.hp.com