Skip to content

Commit e4efdb3

Browse files
committed
add option to hide 'Press ? for help'
1 parent 721ad3e commit e4efdb3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

plugin/NERD_tree.vim

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ call s:initVariable("g:NERDTreeAutoCenter", 1)
5151
call s:initVariable("g:NERDTreeAutoCenterThreshold", 3)
5252
call s:initVariable("g:NERDTreeCaseSensitiveSort", 0)
5353
call s:initVariable("g:NERDTreeChDirMode", 0)
54+
call s:initVariable("g:NERDTreeShowPressForHelp", 1)
5455
if !exists("g:NERDTreeIgnore")
5556
let g:NERDTreeIgnore = ['\~$']
5657
endif
@@ -2996,12 +2997,12 @@ function! s:dumpHelp()
29962997
let @h=@h."\" :OpenBookmark <name>\n"
29972998
let @h=@h."\" :ClearBookmarks [<names>]\n"
29982999
let @h=@h."\" :ClearAllBookmarks\n"
2999-
else
3000+
silent! put h
3001+
elseif g:NERDTreeShowPressForHelp == 1
30003002
let @h="\" Press ". g:NERDTreeMapHelp ." for help\n"
3003+
silent! put h
30013004
endif
30023005

3003-
silent! put h
3004-
30053006
let @h = old_h
30063007
endfunction
30073008
"FUNCTION: s:echo {{{2
@@ -3268,8 +3269,10 @@ function! s:renderView()
32683269
call s:dumpHelp()
32693270

32703271
"delete the blank line before the help and add one after it
3271-
call setline(line(".")+1, "")
3272-
call cursor(line(".")+1, col("."))
3272+
if g:NERDTreeShowPressForHelp == 1
3273+
call setline(line(".")+1, "")
3274+
call cursor(line(".")+1, col("."))
3275+
endif
32733276

32743277
if b:NERDTreeShowBookmarks
32753278
call s:renderBookmarks()

0 commit comments

Comments
 (0)