...
> However, it only dumps it in as if you typed it, so if you have
> metachars such as ".", "/", "*", etc, you'd have to then go back
> and escape them.  For fixed text/space strings, it tends to work
> well, but if you have multiline or extra punctuation characters,
> you have to jump through some hoops.  If it's a big problem, you
> can use something like
>
>   :%s/<c-r>=escape(@0, '.^$/\\')<cr>//gc

I find it much easier to create a simple map that does this
automagically for you.
Those are my most used maps * and #, the same way * and # work in normal mode.

http://vim.wikia.com/wiki/Search_for_visually_selected_text

So visually highlight your text.  Hit * (that is the vmap).

Then you can do:
:%s//to something else/gc

Or
:%s/"hit the up arrow as you type"/to something else/gc

HTH,
Dave

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to