On 04/18/2011 10:35 PM, googler wrote:
   :%s/${eco_prefix}_net_\(\d\d\d\) -new_cell_name
${eco_prefix}_\zs\d\d\d/\1

This is what I actually used after posting the question. But I was
wondering if there is a better way. In this case, I had already
changed the first numbers manually, so I could use that to replace the
second number in the same line.

In addition to the idea of using the

  :let i=1|g/pattern/s//\=i/|let i+=1

solution suggested earlier, you might want to investigate Dr. Chip's VisIncr script[1] which is the Swiss-army-knife of incrementing tools.

-tim

[1]
http://www.vim.org/scripts/script.php?script_id=670




--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to