"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let MapHelp = []
func!MapHelp()
- let i=0
let line=['','']
+ let klines=[]
let fcount=''
+
+ " Calculate string length for sprintf
for line in g:MapHelp
if len(line[0]) > fcount
let fcount = len(line[0])
endif
- " echo len(line[0])
+ call add(klines,line[0]) " for sorting later
endfor
- " echo fcount
+ call sort(klines)
let fmt=" %-" . fcount . "s : %s"
+
+ let i=0
echo "Help:\n"
- for line in g:MapHelp
- echo printf(fmt,line[0],line[1])
+ for line in klines
+ echo printf(fmt,g:MapHelp[i][0],g:MapHelp[i][1])
+ let i = i+1
endfor
+
endfunc
func! CommentMeNow()