Skip to content

Allow opening the tree just like NERDTree in the current window or new splits when opening directories #1459

Closed
@kmoschcau

Description

@kmoschcau

Is your feature request related to a problem? Please describe.
There are two situations:

  1. I have some split windows open, I'd like to open the tree in the window I am currently in with :edit .. What then happens is that the current window is closed and the tree buffer is opened in a side bar window.
  2. I want to open the tree in a new split with :vsplit . or :split .. Here no new window is created, the tree buffer is just opened in a new side bar window.

(I also just remembered that I also like to use :tabedit . and expect the tree buffer to open in a new tab, but I haven't tested what nvim-tree does in that case before I uninstalled it again.)

Describe the solution you'd like

  1. The tree buffer should open in the current window, hiding the buffer that was there before.
  2. The tree buffer should open in the new split window.

Describe alternatives you've considered
Sticking with NERDTree.

Additional context
nvim-tree already has the ability to replace its own buffer in a window with the buffer of a file I want to open. That's already half of my desired workflow. If I could now also just open the tree buffer in the window I want to open a new file in, with the built-in open commends, that would be a lot better than having to add multiple custom keymaps.

Also I checked this just now: This should work even if I open multiple windows with the tree buffer at the same time. The same buffer with the same state could be used in all windows. NERDTree does the same and it was never a problem, nor was there any need for me to have multiple tree states.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedfeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions