On Fri, Jul 22, 2011 at 12:21, John Beckett <[email protected]> wrote:
> Mark Larwill wrote:
>> I often need to make a large list of XML quickly and was
>> wondering if there is a fast way to do this with VIM. For
>> example suppose I have the XML:
>>
>> <user>user1</user>
>> <user>user2</user>
>> <user>user3</user>
>
> Use the following, adapted from tip:
> http://vim.wikia.com/wiki/Increasing_or_decreasing_numbers
>
> :for i in range(1,100) | put ='<user>user'.i.'</user>' | endfor
>
> John

The Ctrl-A macro from the same page also works in your case:
o<user>user1</user>qaYp<Ctrl-A>q98@a
should get you what you want.  This works because Ctrl-A doesn't have
to be on the number - it increments the next number on or after the
cursor.

--
Jimmy

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