Hi

IMHO simpler and more flexible (works if there are lines not matching
the pattern) is:

   :let n=0 | g/opIndex(\zs\d\+/s//\=n/|let n+=1

A useful idiom I learned here.  Usually I muck around with ordinary
searches until the search highlighting shows I've got it right, then

   :let n=0|g//s//\=n/|let n+=1

is what I have to remember, and it's obvious what the start and increment are.

John

Reply via email to