commit 389f33ea81d99a1a5c44d18e657b17411ca11eb4
parent abc0cc4c40cf734c67a03823e844f801c13a7dc6
Author: marty <marty@rodney.(none)>
Date: Wed, 12 Aug 2009 01:38:16 +1200
add quickhelpText to s:KeyMap and display it in quickhelp
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -458,6 +458,7 @@ function! s:KeyMap.Create(options)
let newKeyMap = {}
let newKeyMap = copy(self)
let newKeyMap.key = a:options['key']
+ let newKeyMap.quickhelpText = a:options['quickhelpText']
let newKeyMap.callback = a:options['callback']
call add(s:KeyMap.All(), newKeyMap)
endfunction
@@ -2579,6 +2580,15 @@ function! s:dumpHelp()
let @h=@h."\" ". g:NERDTreeMapToggleFiles .": files (" . (b:NERDTreeShowFiles ? "on" : "off") . ")\n"
let @h=@h."\" ". g:NERDTreeMapToggleBookmarks .": bookmarks (" . (b:NERDTreeShowBookmarks ? "on" : "off") . ")\n"
+ "add quickhelp entries for each custom key map
+ if len(s:KeyMap.All())
+ let @h=@h."\"\n\" ----------------------------\n"
+ let @h=@h."\" Custom mappings~\n"
+ for i in s:KeyMap.All()
+ let @h=@h."\" ". i.key .": ". i.quickhelpText ."\n"
+ endfor
+ endif
+
let @h=@h."\"\n\" ----------------------------\n"
let @h=@h."\" Other mappings~\n"
let @h=@h."\" ". g:NERDTreeMapQuit .": Close the NERDTree window\n"