Nerdtree - save state of opened directories
Asked Answered
I

2

17

A typical workflow for me is opening Vim (MacVim to be precise), doing:

:NERDTree <bookmark>

then manually opening various subdirectories I want to use. Often it's the same set of directories I had open when I was last working on the project. I'm aware of the O recursive-open command but if it's a large tree I then have to go and close a load of them to clear the screen up.

Is there any way of saving the ones that are open / the general 'state'?

Intemperate answered 4/7, 2012 at 12:0 Comment(1)
This sounds like it can only be solved via extending the plugin itself.Bucci
M
6

Unfortunately, there is no way to do this in NERDTree - yet. If you feel like the feature deserves attention, however, you can add it yourself or submit a request for it on GitHub, and it will be available to you soon.

Edit: I took the liberty of submitting the feature request myself; you can track its status here.

Mohn answered 9/4, 2013 at 16:59 Comment(0)
J
-1

Sure just save the session with ":mksession ~/mysession.vim". ":mks" works too. Then just source the file and there you go.

Jayson answered 11/8, 2012 at 12:3 Comment(1)
Mksession (to the best of my knowledge anyway) only restores the files that are open - and it doesn't track the state of the NERDTree directory nodes or even have awareness that it's open when the session was saved. (If you examine the session file the only NERDTree references are the config settings). Actually, the more I've read/understood about this since posting the original question, there isn't (at the moment) any way of doing it at the moment…Intemperate

© 2022 - 2024 — McMap. All rights reserved.