Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!ncar!midway!gargoyle!ddsw1!dattier From: dattier@ddsw1.MCS.COM (David W. Tamkin) Newsgroups: comp.editors Subject: Re: Re: vi for power users Message-ID: <1990Dec17.162337.28565@ddsw1.MCS.COM> Date: 17 Dec 90 16:23:37 GMT References: <4672@umbc3.UMBC.EDU> <7150:Dec1309:42:4690@kramden.acf.nyu.edu> <1990Dec14.174605.19649@ddsw1.MCS.COM> <7426:Dec1621:57:0990@kramden.acf.nyu.edu> Reply-To: dattier@ddsw1.MCS.COM (David W. Tamkin) Organization: Contributor Account at ddsw1, Wheeling, Illinois Lines: 30 brnstnd@kramden.acf.nyu.edu (Dan Bernstein) wrote in <7426:Dec1621:57:0990@kramden.acf.nyu.edu>: | In article <1990Dec14.174605.19649@ddsw1.MCS.COM> dattier@ddsw1.MCS.COM (David W. Tamkin) writes: | > | map ^A :s/$/ $/^M$r 74^V|? ^Ms^M^[$xx0 | > For both forms, why are things done the long way? | > Why ":s/$/ /^M" instead of "A ^["? | | Because that will fail miserably for lines between about 72 and 80 | characters. My point was to present a *reliable* line splitter. My guess is that it will fail if the A-ppended spaces run afoul of the wrapmargin setting. If wrapmargin is off or not in that range, it would work. But you're right, Dan: the :s form is not vulnerable to that problem. | > Why "xx" instead of "2x"? | | On what objective basis is 2x better than xx? It is objectively worse on | at least one basis: it doesn't work. Notice the $ in $xx. Fair enough. Indeed it doesn't: 2x won't function at the end of a line and 2X will delete the second-to-last and (originally) third-to-last characters instead of the last two. xx [I suppose that h2x and :s/..$//^M would work but they are comparatively inelegant] is the right way to go. Thanks for answering my questions. I still don't understand your "I don't use F." David Tamkin Box 7002 Des Plaines IL 60018-7002 708 518 6769 312 693 0591 MCI Mail: 426-1818 GEnie: D.W.TAMKIN CIS: 73720,1570 dattier@ddsw1.mcs.com