Question

I'm looking for a way to either:

  • Persist NerdTree across all open Tabs OR
  • Open Files in new tabs while maintaining the focus on NERDTree

I've tried a number of approaches. For example using

autocmd TabEnter * NERDTreeToggle 

That gets quite messy. The tab opens with NERDTree on the right side. And If I focus on another tab and go back to the new tab it opens a third split with the NERDTree correctly on the right side.

I'm also trying to simply use T when opening a file. The focus doesn't change to new file alright but it NERDTree disappears and I'm left in a 'No Name' tab.

Anyone have a neat solution here?

UPDATE:

reset NERDTree to HEAD - T on open started to work

I'd still really like a solution to keep NERDTree open by default on left of all tabs.

Was it helpful?

Solution

I've seen this project a while ago. I've never tried it because I'm not interested in that feature, maybe others did?

But you should stop trying to use Vim as if it was Gedit or TextMate or whatever other editor you are used to. Tabs in Vim don't work at all like tabs in other editors: you can't think of them as 1:1 "proxies" for specific files because they can contain any number of "files" and their names are succeptible to change in many ways.

Instead, learn about "buffers" and "windows".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top