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?
The NERDTree is a file system explorer for the Vim editor. Using this plugin, users can visually browse complex directory hierarchies, quickly open files for reading or editing, and perform basic file system operations.
After having opened a new file from the tree in a new window press ctrl-w p to switch back to the NERDTree and use it again to return to your previous window.
This NERDTree behavior was a pain for me, too. It annoyed me so much that I learned VimScript and made a plugin that keeps NERDTree consistent across all tabs all the time.
You can grab it on Github: https://github.com/jistr/vim-nerdtree-tabs
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With