Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!umbc3!umbc5.umbc.edu!rostamia From: rostamia@umbc5.umbc.edu (Rouben Rostamian) Newsgroups: comp.editors Subject: Re: vi command does not work in macro Message-ID: <2408@umbc3.UMBC.EDU> Date: 14 Oct 89 18:19:27 GMT References: <273@ssp1.idca.tds.philips.nl> Sender: newspost@umbc3.UMBC.EDU Reply-To: rostamia@umbc5.umbc.edu.UUCP (Rouben Rostamian) Organization: University of Maryland, Baltimore County Lines: 27 In article <273@ssp1.idca.tds.philips.nl> dolf@idca.tds.PHILIPS.nl (Dolf Grunbauer) writes: > >I wanted to duplicate a word somewhere in the middle of a sentence. >The command I used was: > df Pp >(There is a space between the 'f' and 'P') >After having noticed I required a lot of these duplications, I defined: > :map v df Pp >Invoking the macro `v' did not do the job: the word is only preceeded by >a `p', leaving the cursor at the space after the involved word. >Apparently the word is deleted (by the `df '), put back (by the `P') >and the `p' is inserted in the front. This really puzzles me. Why is p >inserted (there is no `aAiI') and why in the front (at the back seems a >more logical place as that is where the cursor is) ? The vi macros apparently do not handle yank and put of partial lines very well. You would run into the same problem if you defined a macro to yank and put a partial line into a named buffer (as in "xy$"xp or in "xy`m"xp). However, full lines are handled correctly (as in "xyy"xp or in "xy'm"xp). I do not know if this is a peculiarity of vi in Ultrix -- I am running Ultrix on a DECstation3100 -- or if it is an inherent bug in vi. Rouben Rostamian Phone: 301 455-2458 Department of Mathematics e-mail: University of Maryland Baltimore Counnty rostamian@umbc.bitnet Baltimore, MD 21228 rostamian@umbc3.umbc.edu