On Mon, 23 Nov 2009 08:47:43 -0600
Tim Chase wrote:
>
>> - there might be a succession of double bars (e.g. ||||||), in which
>> case X must not be inserted.
>
>I think this fails your last test about "||||||", but as this is
>a new detail, I claim leniency :)
>
>To meet your "||||||" test, it should work with
>
> s/||\(|\|\_$\)\...@!/& X/g
played around with it, tested and mapped!
>(I've shifted to the "\...@!" which seems to work where the "\@<!"
>doesn't...kinda surprised me that didn't work).
I didn't understand the subtle differences
> :help /\@<!
> :help /\...@!
but, more importantly, I know where to look now. It wouldn't have
occurred to me that those expressions were in the help file.
It's really helpful that you're posting the help command.
>> I can envisage the need for operating this substitution on every
>> other line of a selected range!
>
>
>Doing things on odd/even lines requires reaching into Vim's
>control structures, something like
>
> :g/^/if line('.') % 2 | s/||\(|\|\_$\)\...@!/& X/g | endif
Implemented!
--
Best Regards,
Tarlika Elisabeth Schmitz
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---