Tuesday, December 22, 2009

RE: search across lines?

Bee wrote:
> 1) Why <C-R><C-R>=substitute rather than <C-R>=substitute ?
> Both work, when I do :reg both show the same register usage!

It's in the tip I referred you to.

> In the second, I use '\V' ('very nomagic')
> to make all but '\' not magic and then escape just '\'
> /\V<c-r>=substitute(escape(@", '\'), '\n', '\\n', 'g')
>
> Both work and all registers look the same.
> Is there some functional difference I am missing?

The tip puts the search pattern in the search history and it's
nice to be able to later recall that pattern. It's slightly
nicer if you don't have ugly \V in patterns, particularly when
it's not required (most searches won't need it).

John

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

No comments:

Post a Comment