Sorry, typo. It has to be:
:let i=1
:g/case/s/%match/\=i/|let i+=1

xulxer wrote:
> Hi,
> On Tue, Oct 07, 2008 at 09:32:09AM -0700, thebishop wrote:
> >
> >Is VIM capable of replacing matching text with a number that
> >increments with each match?
> >
> >For instance:
> >
> >case %match:
> >case %match:
> >case %match:
> >case %match:
> >
> >Becomes:
> >
> >case 1:
> >case 2:
> >case 3:
> >case 4:
> >case 5:
> >
>
> yes vim can. Try:
>
> :let c=1
> :g/case/s/%match/\=i/|let i+=1
>
> Kind regards
>
> Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to