Hong Zhaogang
unread,Jul 30, 2009, 5:32:05 AM7/30/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to worldhunter
function! RangeFill(stop)
let l:num = 1
while l:num <= a:stop
call append(line('$'), l:num)
let l:num = l:num+1
endwhile
endfunction
function! DigitAlign(d,w)
let l:ret = a:d
while len(l:ret) < a:w
let l:ret = "a".l:ret
endwhile
let l:ret = substitute(l:ret,"a","0","g")
return l:ret
endfunction
function! LRCFix(step,flag)
" put current lrc file forward/backward step*10 ms
:g/^\[\d\+:\d\+.\d\+\]/s/^\[\(\d\+\):\(\d\+\).\(\d\+\)\(.*\)$/
\="[".((submatch(1)*60+submatch(2))*1000+submatch(3)*10).submatch(4)/
if a:flag > 0
:g/^\[\d\+\]/s/^\[\(\d\+\)\(.*\)$/\="[".(submatch
(1)+a:step*10).submatch(2)/
else
:g/^\[\d\+\]/s/^\[\(\d\+\)\(.*\)$/\="[".(submatch(1)-
a:step*10).submatch(2)/
endif
:g/^\[\d\+\]/s@^\[\(\d\+\)\(.*\)$@\="[".DigitAlign(submatch(1)/
60000,2).":".DigitAlign((submatch(1)%60000)/1000,2).".".DigitAlign
(((submatch(1)%60000)%1000)/10,2).submatch(2)@
:g/^\[-\d\+\]/s@^\[-\d\+\(.*\)$@[00:00.00\1@
endfunction