Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!csun!srhqla!quad1!ttidca!kevin From: kevin@ttidca.TTI.COM (Kevin Carothers) Newsgroups: comp.editors Subject: Re: vi command does not work in macro Message-ID: <7036@ttidca.TTI.COM> Date: 18 Oct 89 17:52:09 GMT References: <273@ssp1.idca.tds.philips.nl> <62420007@hpl-opus.HP.COM> Reply-To: kevin@ttidcb.tti.com (Kevin Carothers) Organization: Citicorp/TTI, Santa Monica Lines: 38 In article <62420007@hpl-opus.HP.COM> steinbac@hpl-opus.HP.COM (Gunter Steinbach) writes: > > This must be a bug in your implementation. > > As a macro or otherwise, 'df Pp' works fine for me in HP-UX 6.2 on an > HP9000/350 workstation. I dimly remember related problems, though, some > years and OS versions ago. Mine works too. This doesn't, tho: :map ^A ddjjjp (A) Obviously, I'm simply moving the current line down 3 lines. This gives the message "Cannot put inside global/macro". But this DOES work: :map ^A 0d$P I am NO VI internals expert, but the most obvious reasoning is that VI can't scroll the screen from inside a macro. Armed with this basic (maybe erroneous) assumption, I can get something like "(A)" above to work by the following: :map ^A ma3jo^[mb'ad$'bp [...Aren't macros fun? :)] ^ ^ -------------> Please, I know these are unnecessary in this example NOW - My questions: 1. This works file on single lines, but simply terribly on entire paragraphs. Does anyone have macros (hopefully straightforward ones) to move Multiple lines/blocks from within a macro? 2. Does anyone have any ideas on ways to pass parameters to macros? Is there a version of VI that does? -- Kevin Carothers {philabs,csun,psivax}!ttidca!kevin