Search code examples
vimnerdtree

Auto-open NERDTree in "EVERY" tab


Is it possible to open NERDTree in every tab with pressing t or T in NERDTree, if yes, How?


Solution

  • This is probably not the best way, but if you edit plugin/NERDTree.vim and change this:

     exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenInTab ." :call <SID>openInNewTab(0)<cr>"
    

    to this:

     exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenInTab ." :call <SID>openInNewTab(0)<cr>:NERDTree<cr>"
    

    it will alter the binding of 't' in the NERDTree view to first open the file and then open NERDTree. Note, that the NERDTree views will not keep in sync.