Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!cs.utexas.edu!romp!auschs!d75!cello!sanders.austin.ibm.com From: sanders@sanders.austin.ibm.com (Tony Sanders) Newsgroups: comp.editors Subject: Re: macros in vi Keywords: vi Message-ID: <3045@cello.UUCP> Date: 14 Nov 89 23:12:31 GMT References: <1989Nov10.015031.21474@ntvax.uucp> <4528@ski.cs.vu.nl> Sender: news@cello.UUCP Reply-To: sanders@sanders.austin.ibm.com (Tony Sanders) Lines: 28 In article <4528@ski.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >In article <1989Nov10.015031.21474@ntvax.uucp> gene@ntvax.UUCP (Gene De Lisa) writes: >\could someone tell me how to use @ macros in vi? >\the manual i have says follow the @ with the name of a buffer. >\how do you get the macro into the buffer in the first place >\(besides typing them in and yanking them). [...] Yep, you have to _virtually_ type them in and yank them. Meaning you can map a key to do it for you BUT! this causes your file to be [edited]. I've long anguished over that fact that you cannot set/append named buffers without "editing" your file. For example: " find current word as tag (should be ^] and sadly modifies your file) " This is a very simple idea of a word. More complex patterns work also map ** mq:co.^V^M`qd0:s/^\([a-zA-Z_]*\).*/:ta \1/^V^M"wdd@w The vi I currently use doesn't support ^] (I'm trying to get a reasonable vi to compile on my rt runing AIX 2.2.1 :-() so I'm forced to use this hack which touches my .c files. >If you want to set such a macro in EXINIT/.exrc: > > map @a ... I don't believe this is true on various vi's I've tried. This simply maps the sequence @a to "..." Am I wrong/confused or were you just thinking out of context??? -- sanders