How to access nvimtree state? Want to toggle on focus, but not if already open. #1683
-
Hi there. I'd like to be able to swithc between buffer focus and nvimtree focus without toggling the tree needlessly. How do i find out the state of the tree? What's the best way to accomplish this otherwise?
Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can use events to determine the state: You could listen for |
Beta Was this translation helpful? Give feedback.
-
Perhaps I'm not understanding your use case, however it seems that the decision is not necessary: |
Beta Was this translation helpful? Give feedback.
You can use events to determine the state:
:help nvim-tree-events
You could listen for
Event.TreeOpen
andEvent.TreeClose
and record state. It would be best to maintain state per tab.