Hi Jim!

On Mi, 04 Aug 2010, Jim Green wrote:

> Hi,
> 
> I have as section
> 
> sectionA
> service=1
> network=1.1.1.1
> 
> and I want to add sections to make it like
> 
> sectionA
> service=1
> network=1.1.1.1
> 
> sectionB
> service=2
> network=1.1.1.2
> 
> sectionC
> service=3
> network=1.1.1.3
> ...
> until
> sectionZ
> service=26
> network=1.1.1.26
> 
> Could anyone point me how to do this in vim? I thought of using shell
> scripts to do it but might be an overkill,

Probably easiest would be to create a macro.

Another solution would be something like this:
for i in range(1,26) | call append('$', ['Section'.nr2char(64+i), 'service='.i, 
'network=1.1.1.'.i,''])|endfor

(one line)

regards,
Christian

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