🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #2817

adjust(1) vs. fmt(1) (was: Re: VI: Positioning the cursor ("|") from within a macro doesn't work.)

#2817
From: Hans Mulder
Date: Fri, 14 Jun 1991 17:19
39 lines
1831 bytes
In <8000003@hpnmdla.sr.hp.com> stanj@hpnmdla.sr.hp.com (Stan Jaffe) writes:
>How about using the UNIX utility ADJUST? 

Well, the problem is that adjust only exists on some AT&T Unices.

Some of us use a BSDish flavour of Un*x and we use fmt(1), e.g.

{!}fmt -72		# actually, 72 is the default, so just {!}fmt suffices

>{        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.
fmt      the name of the utility
-72      sets the right margin to 72.  All line wrapping is done automatically.

>I have mapped this to a key in my .exrc file.  Use control-M for the return
>key:

I guess you meant to say "Use control-V control-M to get a return in the map:"

map ^A  {!}fmt -72 ^V^M


For some reason, this thread had the title

>> VI: Positioning the cursor ("|") from within a macro doesn't work.

Which is an odd thing to say, since "|" works OK from within a macro,
provided you quote it with two control-V's, e.g. typing

:map v 73^V^V|F r^V^M

gets you a macro that breaks the line at the last space before column 73.
Not that you need such a macro if your system has either adjust(1) or fmt(1).

--
Have a nice day,

Hans Mulder	hansm@cs.kun.nl
Technical Details
Message-ID: <3650@wn1.sci.kun.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!Firewall!uunet!mcsun!hp4nl!sci.kun.nl!cs.kun.nl!hansm
References: <1501@cacilj.UUCP> <8000003@hpnmdla.sr.hp.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!Firewall!uunet!mcsun!hp4nl!sci.kun.nl!cs.kun.nl!hansm
From: hansm@cs.kun.nl (Hans Mulder)
Newsgroups: comp.editors
Subject: adjust(1) vs. fmt(1) (was: Re: VI: Positioning the cursor ("|") from within a macro doesn't work.)
Message-ID: <3650@wn1.sci.kun.nl>
Date: 14 Jun 91 17:19:26 GMT
References: <1501@cacilj.UUCP> <8000003@hpnmdla.sr.hp.com>
Sender: root@sci.kun.nl
Organization: University of Nijmegen, The Netherlands
Lines: 39