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?
+2
A:
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.
jamessan
2010-02-17 19:12:25
+2
A:
You can also use :NERDTreeMirror
. I prefer this to NERDTreeToggle when at least one tree is already open because it keeps the tree consistent across tabs.
Alexander
2010-04-12 09:42:16