Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!metro!cluster!swift!otc!gregm From: gregm@otc.otca.oz.au (Greg McFarlane) Newsgroups: comp.editors Subject: Can you write complex vi macros? Message-ID: <2483@otc.otca.oz> Date: 14 Mar 91 07:33:35 GMT Sender: news@otc.otca.oz Reply-To: gregm@otc.otca.oz.au (Greg McFarlane) Organization: OTC Development Unit, Australia Lines: 19 It seems that you cannot have more than one "undo-able" vi command in the one macro. This means that a complex vi macro must be split into several smaller macros. I'll explain what I mean by an example. Edit a file and type ":map Q rXY". This should map the Q key to "replace the character under the cursor with X and yank the line". But when I type Q, vi tells me "Can't yank inside global/macro" and goes into ex mode. However if I type ":map Q rXT" and ":map T Y", everything is OK. I get this behaviour on a Sparc 1+, a Sun 3/50 and a Pyramid. Does this happen at your site? Is there a reason for this madness? -- ACSnet: gregm@otc.otca.oz.au Greg McFarlane UUCP: {uunet,mcvax}!otc.otca.oz.au!gregm |||| OTC || Snail: OTC R&D GPO Box 7000, Sydney 2001, Australia Phone: +61 2 287 3139 Fax: +61 2 287 3299