Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucsd!nosc!logicon.com!trantor.harris-atd.com!x102c!gbastin From: gbastin@x102c.harris-atd.com (Gary Bastin 60293) Newsgroups: comp.editors Subject: Re: A vi question Message-ID: <4173@trantor.harris-atd.com> Date: 23 Aug 90 13:20:28 GMT References: <14420003@hp-lsd.COS.HP.COM> <3440002@hprnd.HP.COM> <1990Aug19.174035.3946@cid.aes.doe.CA> <2394@root44.co.uk> <1117@ssp11.idca.tds.philips.nl> Sender: news@trantor.harris-atd.com Reply-To: gbastin@x102c.ess.harris.com (Gary Bastin 60293) Organization: Harris Corporation GSS, Melbourne, Florida Lines: 29 In article <1117@ssp11.idca.tds.philips.nl> dolf@idca.tds.PHILIPS.nl (Dolf Grunbauer) writes: >In article <2394@root44.co.uk> gwc@root.co.uk (Geoff Clare) writes: >< ><>>> > I need to do the following in vi. ><>>> > ccccoooossss -> cos >< >This can be done in plain vi by typing: > > %s/^H.//g > >As the backspace sequence is used only to reprint the preceding character and >with this command all duplications are removed. Nope. Afraid this one won't work, either. It DOES clean up all the occurences of "^H." But there is a subtle problem. For example, on my system, the man pages for csh when piped to a file create lots of "^H." occurences, which this does clean. This works fine for overstrikes used to just embolden particular words. But also generated are lines of the form _^HC_^Hs_^Hh, which generates "Csh" with an underline. Using the global replacement of "^H." with nothing completely obliterates the stuff that uses the overstrike for really making underlined words, leaving just the underline characters with nothing above them! Which is not what is desired, I am sure. (Not a flame, just a subtle point!) Gary Bastin /-/-/ Internet: gbastin@x102c.ess.harris.com Mail Stop 102-4826 | phone: (407) 729-3045 Harris Corporation GASD | packet: WB4YAF @ N4JLR.FL.USA.NA P.O.B. 94000, Melbourne FL 32902 Speaking from, but not for, Harris!