vim and NERD Tree: Can NERD Tree persist across tabs in MacVim?

Viewed 8758

When using NERD Tree on MacVim, I can open a file in a new tab by using 't' (or 'T' to open it in the background) in the NERD Tree window, but when I switch to that tab, the NERD Tree window is no longer visible since it remains in the original tab. Is there a way to automatically open NERD Tree in new tabs when opening files from NERD Tree in new tabs? Or can NERD Tree persist across tabs?

3 Answers

The only persistent object in Vim is a buffer. Windows display buffers, tab pages organize windows. If you want to open NERD Tree in the new tab, then call :NERDTreeToggle. Another option would be to open a new tab, open NERD Tree, and then open the file in your freshly created tab.

I wonder, though, why you would want to have a file tree open all the time. It's just a waste of space, most of the time. You can map a key to call :NERDTreeToggle to easily make it visible when you actually need to use it.

Related