"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let MapHelp = []
+func!_MapHelpSort(x,y)
+ if (a:x[0] == a:y[0])
+ return 0
+ endif
+ return a:x[0] > a:y[0] ? 1 : -1
+endfunc
+
func!MapHelp()
let line=['','']
- let klines=[]
let fcount=''
" Calculate string length for sprintf
if len(line[0]) > fcount
let fcount = len(line[0])
endif
- call add(klines,line[0]) " for sorting later
endfor
- call sort(klines)
+ call sort(g:MapHelp,function("_MapHelpSort"))
let fmt=" %-" . fcount . "s : %s"
let i=0
echo "Help:\n"
- for line in klines
- echo printf(fmt,g:MapHelp[i][0],g:MapHelp[i][1])
+ for line in g:MapHelp
+ echo printf(fmt,line[0],line[1])
let i = i+1
endfor
call add(MapHelp,['F5','Add / Delete comment'])
map <F5> :call CommentNewLine()<CR>
vmap <F5> :call CommentToggle()<CR>
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Alt+h - Help
+call add(MapHelp,['Alt+h','This Help'])
+map ˙ :call MapHelp()<CR>
+map \eh :call MapHelp()<CR>