Skip to content

Option to prevent nvim-tree buffer resisting being substituted #1829

@Tolomeo

Description

@Tolomeo

Is this a question?
No

Can this functionality be implemented utilising API?
No

Is your feature request related to a problem? Please describe.
I like to use the project tree explorer as a split window rather than a project drawer so I use nvim-tree configured like vinegar.
The issue I have is its buffer resists being replaced, forcing me every time to close it manually.
That happens for example trying to open a location from the quickfix list and nvim-tree is the only other buffer displayed in a window

Describe the solution you'd like
It would be nice to have a configuration option which could make it possible to turn off the default behaviour (resisting to buffer replacements).

Describe alternatives you've considered
None yet

Additional context
I could attempt a PR if needed

Activity

alex-courtis

alex-courtis commented on Dec 18, 2022

@alex-courtis
Member

That is useful. It would replace the second part of the vinegar recipe and be more consistent for all operations.

We'll need an appropriate name for the option. Perhaps at the top level.

   eject_opened_buffer = true,

I could attempt a PR if needed

Your contribution would be gratefully appreciated: CONTRIBUTING.md

Tolomeo

Tolomeo commented on Dec 23, 2022

@Tolomeo
Author

By investigating the possible implementation I noticed that it is not nvim-tree resisting being replaced, it is instead vim which prefers to open a new window instead of replacing the tree buffer.
I couldn't find explicit documentation of the exact behaviour. It should be controlled by the global switchbuf but there seems to be exceptions as the same happens with windows hosting terminal buffers.

It is not an issue related to nvim-tree then, the plugin is working as expected.

steliyan

steliyan commented on May 12, 2023

@steliyan

@Tolomeo have you figured out a way? I've created a discussion: #2206

Tolomeo

Tolomeo commented on May 15, 2023

@Tolomeo
Author

Hey @steliyan, unfortunately not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alex-courtis@steliyan@Tolomeo

        Issue actions

          Option to prevent nvim-tree buffer resisting being substituted · Issue #1829 · nvim-tree/nvim-tree.lua