|
|
||
function! SortLine() range
let lines = []
let cl = a:firstline
while cl <= a:lastline
let line = getline(cl)
call add(lines,line)
let cl += 1
endwhile
let cl = a:firstline
call sort(lines)
for i in lines
call setline(cl,i)
let cl += 1
endfor
endfunction
不細工だ。
いまさら気づいたけど普通にあるじゃねーか
:sort
何か作るにしてもまずヘルプを読めということですね。