Article View: comp.editors
Article #2793Re: Paste from macro in VI
From: Paul Slootman
Date: Wed, 12 Jun 1991 06:42
Date: Wed, 12 Jun 1991 06:42
20 lines
1314 bytes
1314 bytes
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 <macrosequence> :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
----------------
Technical Details
Message-ID:
<1096@dri500.dri.nl>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!mcsun!hp4nl!dri500!slootmanReferences:
<1991Jun11.183544.514@otago.ac.nz>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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