🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3091

Re: Re: Reformatting in vi (format program)

#3091
From: William A. Stubblebine
Date: Mon, 08 Feb 1988 22:39
48 lines
2005 bytes
/ hplsdlw:comp.editors / robert@arizona.edu (Robert J. Drabek) writes:

> There has been a problem I have had with formatting paragraphs in
> vi: the definition using "}" seems to be "up to the next empty line",
> but when editing *roff files I only want to format up to the next
> line containing a dot command.

> So, how do I easily tell vi to stop where desired?
> -- 
> Robert J. Drabek
> Department of Computer Science
> University of Arizona
> Tucson, AZ  85721
> ----------

In your .exrc file try:

set para=P\ DSDETSTEALDLBLRLLILESGspbp
set sect=H\ SKNHSHHU

Set para will cause } or { to stop at the following n/troff commands (in
addition to a blank line):

.P		  .TE		    .RL		      .SG
.DS		  .AL		    .LI		      .sp
.DE		  .DL		    .LE		      .bp
.TS		  .BL

(Note the treatment of the single letter macro .P - the space must be
escaped.)

Similarly, set sect will cause ]] or [[ to stop at the following n/troff
commands (in addition to start/end of file:

.H		  .NH		    .SH		      .HU
.SK

You may substitute other favorite n/troff commands, but there is a limit
to the number of paragraph definitions, which, for my vi implementation,
is defined by the length of the set para directive above.

                                Bill Stubblebine
                                Hewlett-Packard Logic Systems Div.
				8245 N. Union Blvd.
                                Colorado Springs, Co. 80918
				ARPA: was%hp-lsd@hplabs.hp.com
				UUCP: {hplabs,hpfcla}!{hpldola,hp-lsd}!was
                                (303) 590-5568
Technical Details
Message-ID: <3760002@hplsdlw.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!hplabs!hpcea!hpfcdc!hpldola!hp-lsd!hplsdly!hplsdlw!was
References: <222@gandalf.littlei.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!hplabs!hpcea!hpfcdc!hpldola!hp-lsd!hplsdly!hplsdlw!was
From: was@hplsdlw.HP.COM (William A. Stubblebine)
Newsgroups: comp.editors
Subject: Re: Re: Reformatting in vi (format program)
Message-ID: <3760002@hplsdlw.HP.COM>
Date: 8 Feb 88 22:39:41 GMT
References: <222@gandalf.littlei.UUCP>
Organization: HP Logic System Div. - ColoSpgs, CO
Lines: 48