Hi Ada,

You can record a macro using the q command and use ctrl-a to increment numbers.

I think this tutorial might help you do what you ask:
http://www.thegeekstuff.com/2009/01/vi-and-vim-macro-tutorial-how-to-record-and-play/

Cheers,
    Nick

On Sat, Dec 4, 2010 at 6:42 PM, Ada <holybre...@gmail.com> wrote:
>
>
> I have a long xml just like this:
>
>    <events>
>        <event type="normal">
>
>        </event>
>        <event type="wait" duration="10"/>
>        <event type="normal">
>
>        </event>
>        <event type="normal">
>
>        </event>
>   ....
>   </events>
> Now I want to insert some number attributes just like this:
>    <events>
>        <event num="1" type="normal"  >
>
>        </event>
>        <event num="2" type="wait" duration="10"/>
>        <event type="normal">
>
>        </event>
>        <event num="3" type="normal">
>
>        </event>
>   ....
>   </events>
> I know VIM must can do that work,but HOW? Thanks a lot, By the way,
> though I'm a newbie of VIM,but I really love it ...
>
> --
> 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
>

-- 
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