Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!julius.cs.uiuc.edu!rpi!bu.edu!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.editors Subject: Re: Re: vi for power users Message-ID: <7426:Dec1621:57:0990@kramden.acf.nyu.edu> Date: 16 Dec 90 21:57:09 GMT References: <4672@umbc3.UMBC.EDU> <7150:Dec1309:42:4690@kramden.acf.nyu.edu> <1990Dec14.174605.19649@ddsw1.MCS.COM> Organization: IR Lines: 30 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. > Why "? ^M" instead of "F ", as long as that the space will be on that line? Because I wrote the macro and I don't use F. You're right, F is better so that the previous search string stays intact. > Why "s^M^[" instead of "r^M"? I've seen versions of vi where r doesn't behave properly with a newline. > "r^M" works fine in my own reformatting macro. > (I won't post it because it has other bugs.) Exactly. My point was to present a *reliable* line splitter, something that everybody could use without having to worry about bugs. > Why "xx" instead of "2x"? This is a macro in one's .exrc, so saying that > "`xx' is easier to type every time you use it than `2x'" doesn't count. 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. ---Dan