Newsgroups: comp.unix.misc
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!news.cs.indiana.edu!ariel.unm.edu!hydra.unm.edu!dmckeon
From: dmckeon@hydra.unm.edu (Denis McKeon)
Subject: Re: VI (can you fully justify test)
Date: Wed, 20 Mar 91 17:34:47 MST
References: <1991Mar12.055337.10655@vpnet.chi.il.us> <1991Mar13.164026.12718@iwarp.intel.com> <1991Mar13.184102.1528@decuac.dec.com>
Organization: Connemara - Computing for People
Keywords: VI, vi, editing tricks
X-Mailer: Mail User's Shell (7.0.3 12/22/89)
Status: OR
Message-ID: <1991Mar21.003444.18308@ariel.unm.edu>
Lines: 28


For quick & dirty justification within vi, try:

:map + J074lBhr^V^M

where ^V^M is control-V control-M, of course.  It does a join, then a
split before the word that bridges col 74 (season to taste).  This
allows you to handle the small case of a few lines, or a short paragraph
by repeatedly hitting + down to the last line (and without !'ing out).

Bugs
	it assumes that the first two lines together are >= 74 chars.

	you'll have to open a fresh empty line after the paragraph.

	you'll need an empty line after the last line in the document

	TAB characters are counted as 1 char instead of <tabstop> chars.

	there was ome reason to use 074l instead of 74|, but I don't
	recall what the reason was.

Overall, this is a messy hack - but when you use vi on a PC, without 
any normal Unix utilities, let alone fmt, it is a (very) small blessing.

--
Denis
dmckeon@hydra.unm.edu
