Vi macro problem solved

Robert_Toxen%anvil.UUCP at harvard.arpa Robert_Toxen%anvil.UUCP at harvard.arpa
Wed Mar 19 23:35:09 AEST 1986


> From: "Todd C. Williams [Jedi Knight]" <yoda%ittatc.atc.itt.uucp at BRL.ARPA>
> Subject: Vi bug: multi-line abbrev w/ ai set
> 
> I want to have an abbreviation that will print out the following 5 lines:
> 
> 	main(argc,argv)
> 		int argc;
> 		char *argv[];
> 	{
> 	}
> 
> I have set autoindent in this file.  The problem is that, with autoindent
> set, multiline abbreviations are tabbed in by autoindent, with (apparently)
> no way to stop this.
> 
> EXAMPLE that does NOT work:
> 
> set	autoindent
> abbreviate	aaaaa	main(argc,argv)^M^Iint argc;^Mchar *argv[];^M^D{^M}
> 
> We are running 4.1bsd on a VAX-11/780.
> |  Todd C. Williams
> |  {decvax, et al.}!ittatc!dcdvaxb!tcw

Try:
set	autoindent
abbreviate	aaaaa	main(argc,argv)^M^Iint argc;^Mchar *argv[];^M^V^D{^M}

Note that to enter ^V^D you must precede each with a control-V, i.e. type:
^V^V^V^D. Note also that you can't get "0^D" but putting lots of "^D"s will
get the same thing.

Bob Toxen
Stratus Computer
{ucbvax!ihnp4,harvard}!anvil!bob
============================



More information about the Comp.unix.wizards mailing list