Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!cybvax0!frog!custom!boykin From: boykin@custom.UUCP (Joseph Boykin) Newsgroups: comp.unix.wizards Subject: Re: YAVB - yet another VI bug Message-ID: <760@custom.UUCP> Date: Mon, 12-Oct-87 13:05:00 EDT Article-I.D.: custom.760 Posted: Mon Oct 12 13:05:00 1987 Date-Received: Thu, 15-Oct-87 06:38:47 EDT References: <270@astra.necisa.oz> Organization: Custom Software Systems; Natick, MA Lines: 31 Summary: Not a bug (per se) In article <270@astra.necisa.oz>, dave@astra.necisa.oz (Dave Horsfall) writes: > A common technique in VI is to use tab stops every 4 columns by using > sw=4 and ^D ^T. However, after a career of bashing the TAB key, it is > difficult to adjust. > > One would think that TAB could be mapped into ^T with "map! ^V^I ^V^T", > but no - it says "Missing rhs". Obviously, the ^V does not escape white > space. > > Is this a bug or a feature? I don't have VI source, which is probably > just as well - it's been known to drive strong men (& women?) to drink. I'm not sure whether this should rightly be considered a bug or not, but personally I would probably say no. By definition, VI use white space to separate the two parameters to the macro. If you use ^V^I the only thing you get is a ^I and VI will obviously treat this as white space. The way around this is to use *TWO* Control-V's, e.g.: :map! ^V^V^I ^V^T The result is that a ^V is now entered into the input buffer and VI interprets the remainder of the line as you would want. Note that the same situation arises when trying to use spaces or carriage returns. -- Joe Boykin Custom Software Systems ...necntc!custom!boykin