nvim-neo-tree / neo-tree.nvim

Neovim plugin to manage the file system and other tree like structures.
MIT License
3.85k stars 224 forks source link

Feature Request: Displaying Multiple Sources #395

Open ElPiloto opened 2 years ago

ElPiloto commented 2 years ago

Is there any way to display multiple sources at the same time? For example, displaying a tree whose root node has two children: FileExplorer and Buffers. The children of FileExplorer are the files in the current directory. The children of Buffers are the open buffers. Furthermore, taking actions on the FileExplorer nodes would give you file actions, taking actions on the Buffer nodes would give you buffer actions.

Basically, I think it'd be nice to emulate the "side drawers" in VSCode (or other IDEs) where you have different sections (e.g. file explorer, file outline, etc) all living in the same window split.

cseickel commented 2 years ago

There is no way to do this. I'm not inclined to make all the changes needed to accomplish this because I wouldn't have interest in using it this way. I prefer to switch between sources rather than try to display all at once.

I think a better solution would be the idea to create grouped windows where separate trees can be docked together, as suggested in #360. The good news is that I think Nui has added some functionality for layouts which would likely make such work easier. I still wouldn't use that feature though, so I don't think I'll be the one to add that. I would certainly work with someone who wants to submit a PR to add these features.

I could also see someone creating a general purpose plugin that docks any arbitrary set of windows. In a perfect world, I think this would be the ideal solution.

ElPiloto commented 2 years ago

Yeah I can see how this would be a lot to implement. I do not think it's such an ill-fitting use case though. I suggested this to use with custom sources that all pertain to file types (e.g. FileExplorer + bookmark source + project source). And I suggested it in the same tree because it has the upshot of automatically collapsing/expanding sections, instead of having to deal with collapsing splits. But I understand it is messier to have to implement node-type specific actions. I'm still trying to figure out how to add custom sources so I'm not in a position to submit a PR myself.

cseickel commented 2 years ago

It's not that it's not a good idea that a lot of people would like, it just doesn't fit with how it was architected and it's not a project I would undertake because I wouldn't personally utilize it.

It's certainly possible to do though. I'm not sure if it's easier to add in the ability to show multiple sources or to create a new source that is a combo of others. Maybe a little of both is the way to go actually, a new source that is designed to combine other sources in a generic way. This is actually interesting now that I think about it...