If finally found a way.
I edited the nerdtree_plugin/vim-nerdtree-tabs.vim
file, adding these functions:
" === Stepped Open/Close functions ===
" focus the NERDTree view, creating one first if none is present
fun! s:NERDTreeSteppedOpen()
if !s:IsCurrentWindowNERDTree()
if s:IsNERDTreeOpenInCurrentTab()
call s:NERDTreeFocus()
else
call s:NERDTreeMirrorOrCreate()
endif
endif
endfun
" unfocus the NERDTree view or closes it if it hadn't had focus at the time of
" the call
fun! s:NERDTreeSteppedClose()
if s:IsCurrentWindowNERDTree()
call s:NERDTreeUnfocus()
else
let l:nerdtree_open = s:IsNERDTreeOpenInCurrentTab()
if l:nerdtree_open
silent NERDTreeClose
endif
endif
endfun
I also made a pull-request to the author to ask him if he wants to add theses functions upstream.
The author added my pull-request to the main repository, so with the next release, you can just call the functions directly.
Hope it helps people.