🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #2831

Re: VI: Positioning the cursor ("|") DOES work!!

#2831
From: Alvin "the Chipmunk" Sylvain
Date: Sun, 16 Jun 1991 20:32
59 lines
3408 bytes
Let me make a correction here.  I remembered seeing a post some time ago
about mapping TAB into ^T so you could use the TAB key to do a Shift-In
instead of insert ^I.  In order to do that successfully, you had to
enter ^V THREE TIMES before the TAB.  Therefore, I thot, what the hell,
let's try it with "|".

Written in article <165175@felix.UUCP>
    by asylvain@felix.UUCP (Alvin "the Chipmunk" Sylvain):

> Written in article <14977@ulysses.att.com>
>     by wmb@ulysses.att.com (W M Brelsford):
> 
> : In article <1501@cacilj.UUCP>, jurgen@cacilj.UUCP (Jurgen Heymann) writes:
> : > I am trying to position the cursor on a specific column using a
> : > :map macro.
> : 
> : "|" needs to be protected with "^V" (Ctrl-V).
>
> At the risk of calling forth an old Usenet cliche ...
> 
> "Bzzzzzt!  We're sorry, but that's the wrong answer!"
> 
> I know.  I tried it in posting this article.  Control V does *not* quote
> the "pipe" character (at least not on an Ultrix VAX).

OK, I did a tad more research, and I think I may have stumbled on the 
solution here.  What needs to be done is to "quote" the quote character, 
which will then successfully quote the command separator.  To-wit:

Type  :map K 72^V^V|?[- ]^V^Ma^V^MJ

Translation:

    :map K      in "ex" mode, map the letter K
    72          position 72 (regardless of quantity of tabs)
    ^V^V        press control V TWICE
    |           "vi"'s column command (but "ex"'s command separator)
    ?           search backward for ...
    [- ]        ... the first hyphen or space (to split both words
                         and hyphenated words, such as mother-
                         in-law.)
    ^V^M        press control V, then RETURN, to end the search string
    a           enter append mode, so you can add ...
    ^V^M        ... a carriage return, quoted of course with ^V.
    J           Join the next line to the end of the new next line.

I've checked this out, and it works beautifully!  No need to call
"expand" or "adjust" or "fmt" or any other external routine!

Success at last!!!  Nothing like trying to wring 20th century features 
out of a 19th century product!
--
Alvin ===== asylvain@felix.UUCP ===== hplabs!felix!asylvain ===== 
"hplabs!felix!asylvain"@uunet.uu.net
(I always try to respond to mail, if possible.  If you don't hear back 
from me, try changing "hplabs" to "ccicpg," "spsd," or "lawnet.")
DISCLAIMER: It's all in fun, folks, no flames intended.  Any similarity
between my opinion and that of my employer is purely coincidental and
sufficient reason to change my opinion, although I'll still be right.
Technical Details
Message-ID: <165192@felix.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!mvb.saic.com!unogate!unocal!genisco!arcturus!felix!asylvain@felix.UUCP
References: <1501@cacilj.UUCP> <14977@ulysses.att.com> <165175@felix.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!mvb.saic.com!unogate!unocal!genisco!arcturus!felix!asylvain@felix.UUCP
From: asylvain@felix.UUCP (Alvin "the Chipmunk" Sylvain)
Newsgroups: comp.editors
Subject: Re: VI: Positioning the cursor ("|") DOES work!!
Keywords: vi cursor
Message-ID: <165192@felix.UUCP>
Date: 16 Jun 91 20:32:55 GMT
References: <1501@cacilj.UUCP> <14977@ulysses.att.com> <165175@felix.UUCP>
Sender: daemon@felix.UUCP
Reply-To: asylvain@felix.UUCP (Alvin "the Chipmunk" Sylvain)
Distribution: usa
Organization: Foundation for the Increased Wealth of Chipmunks                                Send in your pledges now! (Visa/Mastercard accepted)
Lines: 59