nvim-tree.lua
nvim-tree.lua copied to clipboard
No different buffers in different tabs
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?
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
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. :)
I could work out something i guess, but this might lead to new issues that i might not want :)
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.
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
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.
There are now multiple tree buffers, so each tab retains its own state.
Please reopen if you have any further questions or bugs.
@alex-courtis i believe it does not ? There is still only one tree state for all buffers
@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.
Can I configure auto_sync_buffers cross all of the tabs?
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?
@alex-courtis, I have 2 opened Nvim tabs. After updating one tab I want to have the same situation in the second tab.
https://user-images.githubusercontent.com/9537753/170888264-7df6117a-f138-4d4b-982a-7d8a8e6d976f.mov
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.
See #877
See #1847 for ideas on tcd
vs lcd
.
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: https://github.com/nvim-tree/nvim-tree.lua/discussions/1847#discussioncomment-4567184
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.
Tracking at
- #2255