test


:for i in range(2,6) | call append(line("$"),"7.2." .i . " " ) | endfor

参考:http://nanasi.jp/articles/code/io/buffer-write.html

      • -

let t=input("text
") | let s=input("start:") | let e=input("end:") | for i in range(s,e) | call append(line("$"), t .i . " " ) | endfor

参考:http://nanasi.jp/articles/code/interactive/input.html

    • -


function! b:Test()
let t=input("text:") | let s=input("start:", 1) | let e=input("end:")
let a=line(".")
call append(a,t." ") | let a += 1
for i in range(s,e) | call append(a,t.".".i." ") | let a += 1 | endfor
endfunction
nmap :call b:Test()
imap :call b:Test()