Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per Tab nvim-trees #457

Closed
LouisTrinczek opened this issue Jun 17, 2021 · 17 comments
Closed

Per Tab nvim-trees #457

LouisTrinczek opened this issue Jun 17, 2021 · 17 comments
Labels
feature request QOL Quality Of Life Improvement

Comments

@LouisTrinczek
Copy link

Hey, when I create a new tab in Nvim, with the :tabnew command, and open Nvim Tree in both tabs.

When I now open for example a frontend directory in one tab, and go into a backend directory in the other tab, it goes into the backend directory in both tabs.

Is this wanted or is this a bug, and is there a way to change this behavior?

@kyazdani42
Copy link
Member

currently there is only one buffer for the tree, i do not keep track of multiple tree instance under multiple paths, although it could be made easily i think

@LouisTrinczek
Copy link
Author

Right now how I do it is to have multiple terminal tabs open. But this isn't really the way to go i guess. It works for now, but is kinda annoying on fullstack projects. :)

@kyazdani42
Copy link
Member

kyazdani42 commented Jun 29, 2021

I could work out something i guess, but this might lead to new issues that i might not want :)

@eirabben
Copy link

I would also like to request the ability to have a separate state for each tab. Having a different root or open / closed state in the tree for different tabs is something I use pretty often.

Maybe a setting like sync_between_tabs to turn it on or off.

@svermeulen
Copy link
Contributor

Yeah, before I migrated to nvim-tree, I used defx and as one example, would often open multiple defx buffers to do things like copy and paste files to a different directory

@kyazdani42
Copy link
Member

I have a few refactorings to do in order to implement this, because 1) the view buffer is loaded only once during startup (which was one of my worst design choice...) and 2) i have only 1 global variable for managing the explorer state.

@alex-courtis
Copy link
Member

There are now multiple tree buffers, so each tab retains its own state.

Please reopen if you have any further questions or bugs.

@kyazdani42
Copy link
Member

@alex-courtis i believe it does not ? There is still only one tree state for all buffers

@alex-courtis
Copy link
Member

alex-courtis commented Apr 3, 2022

@alex-courtis i believe it does not ? There is still only one tree state for all buffers

Whoops. Either way, the nvim-tree in each tab has its own state and is not affected by the others.

NvimTreeRefresh does still cause unexpected behaviour across tabs, such as collapsing parts of the tree. Such behaviour is inconsistent. Reopening.

@alex-courtis alex-courtis reopened this Apr 4, 2022
@mario-amazing
Copy link

Can I configure auto_sync_buffers cross all of the tabs?

@alex-courtis
Copy link
Member

Can I configure auto_sync_buffers cross all of the tabs?

Not sure what you mean by that... is there something you could quickly put together to demonstrate?

@mario-amazing
Copy link

@alex-courtis, I have 2 opened Nvim tabs. After updating one tab I want to have the same situation in the second tab.

sync_tabs.mov

@alex-courtis
Copy link
Member

alex-courtis commented May 30, 2022

I see. Desired functionalities:

  • One nvim-tree across multiple tabs, with identical / mirrored state
  • Completely separate nvim-trees for each tab, with their own state that does not affect others

This is a non-trivial amount of effort.

@alex-courtis
Copy link
Member

See #877

@alex-courtis
Copy link
Member

See #1847 for ideas on tcd vs lcd.

@lougreenwood
Copy link

I see. Desired functionalities:

  • One nvim-tree across multiple tabs, with identical / mirrored state
  • Completely separate nvim-trees for each tab, with their own state that does not affect others
    This is a non-trivial amount of effort.

Also, I see this thread: #1847 (reply in thread)

Just to add a voice, my personal use-case for multi tab is using tabs to manage collections of buffers in the same project / git repo. So I'd ideally see independent nvim-trees per-tab (because each tab represents a collections of files which may or may not live in the same local dir, but do all exist in the same cwd) but the tree would be using the same cwd across all tabs.

@alex-courtis alex-courtis changed the title Per Tab nvim-trees Instanced nvim-trees May 27, 2023
@alex-courtis alex-courtis changed the title Instanced nvim-trees Per Tab nvim-trees May 27, 2023
@alex-courtis
Copy link
Member

alex-courtis commented Jun 4, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request QOL Quality Of Life Improvement
Projects
None yet
Development

No branches or pull requests

7 participants