On 2006-07-13, [EMAIL PROTECTED] wrote: > Hello, > > I have a mapping which immediately searches for visually selected items. > It achieves this by yanking the selected text and exec[utes] a search for > the register content > This works so far. > > vmap / y:execute "/".escape(@",'[]/\.*')<CR> > > Now I tried this first time for multiline selects, but it does not work: > Selecting this: > > USE ICCS_2005 > GO > > leads to: > -> E486: Pattern not found: USE [EMAIL PROTECTED]@
> How can I have \n instead of thes ^@ - characters to make the search work? Someone posted a similar mapping to this list some time ago and I just recently enhanced it to work with multi-line patterns. vmap <silent> g/ y/<C-R>=substitute(escape(@", '\\/.*$^~[]'), '\n', '\\n', 'g')<CR><CR> HTH, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA