Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!mcsun!hp4nl!dri500!slootman From: slootman@dri.nl (Paul Slootman) Newsgroups: comp.editors Subject: Re: Paste from macro in VI Message-ID: <1096@dri500.dri.nl> Date: 12 Jun 91 06:42:18 GMT References: <1991Jun11.183544.514@otago.ac.nz> Organization: DataCount Register Informatici, Wierden, The Netherlands Lines: 20 In article <1991Jun11.183544.514@otago.ac.nz> andrew@otago.ac.nz writes: >For a long time I have been trying to find a way around an anoying feature of >vi. What I want to do is to create a macro (with :map) that will copy the >contents of this line onto the end of itself. >This can be done outside a macro with YPJ [...] Try: :map :s/.*/&&/^V^M The ^V^M is a control-V followed by a return, to get the return into the mapping. Note: this does not do exactly the same as YPJ; *that* inserts a space between the original contents and the newly appended characters. To get the same effect with this mapping, add a space between the two ampersands ('&'). -- ---------------- :slootman@dri.nl : When you get to the point where you think that nothing :+ 31 5496 88831 : is impossible, try pushing toothpaste back into a tube ----------------