Here is the initial text.
test1
test2
Only two lines in the text.
I want to insert strings sequence into from 5th line into 16th line. I have tried it with below codes.
for i in range(1,12)
echo ".item".i.","
endfor
1.the initial text.
2.to enter into command mode and input the codes
Two problems to be solved.
1.echo command output the first string .item1 before endfor.
for i in range(1,12)
echo ".item".i.","
2.How create the strings sequence into specified line:from 5th till 16th in edited text with vimscript?
The desired result is as below.
Almost done!
What i get is as below with the command :pu! =map(range(1,12), 'printf(''item%1d'', v:val)').
Both of them can't work.
:5pu! =map(range(1,12), 'printf(''item%1d'', v:val)')
:5,16pu! =map(range(1,12), 'printf(''item%1d'', v:val)')
The last issue for my desired format is when the cursor is on the 3th line ,how to create the desired output?


