Ok thanks a lot
Thibaut

On 18 May, 11:15, <geoffrey.w...@thomsonreuters.com> wrote:
> > -----Original Message----- From: vim_use@googlegroups.com
> > [mailto:vim_...@googlegroups.com]on Behalf Of Thibaut Sent: 18 May 2010 
> > 09:44
> > To: vim_use Subject: Use a variable as a pattern in a substitution
>
> > Hello, I am trying to do a substitution where the pattern is the text a
> > visually selected before.  I have looked in the archives and in the tips but
> > I do not find the right way to do it.  the command I first thought was:
> > :s/@*/bar/ but it won't work.  Does anybody have an idea to do it?
>
> > Thanks Thibaut
>
> You can use CTRL-R to insert the value of a register into the command line, 
> see
> :help c_CTRL-R
>
> So in this case you'd type
>
> :s/<CTRL-R>*/bar/
>
> That's using a register directly, if you actually want to use a variable then
> you can use the expression register "=" e.g. type
>
> :let myvar="xxx"
> :s/<CTRL-R>=myvar<Enter>/bar/
>
> regards,
> Geoff
>
> PS sorry for sig below, I would have replied through Google Groups but this
> message doesn't seem to be appearing there...
>
> Reuters Limited, a Thomson Reuters company, is a company incorporated under 
> the laws of England and Wales (registered number 145516) having its 
> registered office and address for service at the Thomson Reuters Building, 30 
> South Colonnade, Canary Wharf, London, E145EP, United Kingdom.
>
> This e-mail is for the sole use of the intended recipient and contains 
> information that may be privileged and/or confidential. If you are not an 
> intended recipient, please notify the sender by return e-mail and delete this 
> e-mail and any attachments.
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visithttp://www.vim.org/maillist.php

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to