-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
[FEATURE] restore nvim-tree folder structure base on deepest restored buffer? #196
Comments
Hey 👋 auto-session has exactly zero control over how nvim-tree gets restored. You can try to use a post_restore hook to run whatever command makes nvim-tree do what you want it to do. Relevant issue: |
After doing some tests, this works for me on nvim v0.8.2:
With above config, Thanks. |
@rmagatti : how can i restore nvimtree when i switch sessions? I use auto-session with telescope-project.nvim and from your comment here I've set It switched ok (all buffers restored ok) but I want nvim-tree also opened after switched to new project (despite of current/old session having nvim-tree open or not, switching to project always have nvim-tree closed) I had this setup of auto-session:
note, this time i use lua instead of vimscript. Basically i want to ask how to switch projects (sessions) and having it like exactly like you just restore a session? meaning switching == restoring behavior. |
It's likely just a timing issue. You're using Also, note |
tks but:
will keep cursor at nvimtree buffer, that's not what i want, as i want: open nvim-tree at pre-restore -> restore -> cursor at last focused buffer ----> how can i do this? |
The cursor moves to the nvim-tree buffer because that's apparently the behaviour nvim-tree chooses. Auto Session has no control over what happens when you call |
thanks, nvim-tree does not have that feature close but not focus, switched to neotree for that and worked like a charm now. |
I got this issue, step (clean up/remove all saved session files from cache):
|
after 8 if stay in one of project A or B and open nvim, and switch A and B back and forth, the issue is not happens. Only if i cd to a folder that is not current A or B, the issue is happen @rmagatti EDIT: again this issue is not happens when i'm open nvim under exactly path of a project (sub or parent folder still have issue) |
can you re-open this? or should i create a new one? |
At this point, I don't think the issues you're seeing have anything to do with auto-session. If you'd like to open a discussion instead to get help with your config that should work better, or even reach out in the Neovim channel in Matrix. Happy to help with anything specific to auto-session though 👍 |
switched to https://github.com/noib3/nvim-cokeline and don't see this issue: akinsho/bufferline.nvim#655 |
I have some buffers to restore at startup of nvim.
I also have nvim-tree setup and start when nvim start.
current behavior is that when i start nvim: nvim, auto-session will restore and put me/cursor to buffer of nvim-tree with all folders closed.
but i want the folders are expanded bases on the deepest buffer on the session.
i.e:
so if after restore session i have file3 in buffer, i want nvim-tree also expand its folder structure to fder3/
if after restore session i have file8 in buffer, i want nvim-tree also expand its folder struture to fder8/
The text was updated successfully, but these errors were encountered: