Comments (8)
I think just load up the last stored version for ease, as user probably assume that they'll have only one session to restore under a folder.
yes, I agree, this is probably the easiest and most common scenario, hence good for a first proof of concept. I will start working on it later in the day :)
say i open neo-tree and other buffers and save that session, this plugin will restore the neo-tree buffer also but it should not be stored with other buffers, instead neo-tree buffer should be
closed
andopen
when restore, check this setting:
I see. This seems to be specific to neo-tree
and I would need a bit more time to dig into their code and check how they are implementing the autorestore of their buffers.
For the moment I will focus on auto-load in the current dir (as it is a general case that can be used by everybody) and then look into plugin-specific integrations, if possible.
from nvim-possession.
I have opened a PR where I somewhat managed to workaround the treesitter issue: it would be great if you could help me test if this is the intended behaviour you proposed (you may specify and install the corresponding branch with most package managers).
from nvim-possession.
The change has been merged on main
with v0.0.2 and is available if you update the plugin via your plugin manager.
from nvim-possession.
Good morning and thank you for your suggestions!
i can't call neo-tree when restore session or this plugin does not aware of tree
Could you expand on what this behaviour is? I do not use neo-tree
myself, so I do not know what is expected here.
and can you add auto restore base on current dir, so we don't have to load ourselves
Yes, this is planned, though I am still trying to understand what's the best way to implement it. Say for example there are 2-3 different sessions in the current dir, which one would you choose to autoload (or equivalently would you prompt the user all the times to choose, or would you just load up the first in the list)?
from nvim-possession.
Yes, this is planned, though I am still trying to understand what's the best way to implement it. Say for example there are 2-3 different sessions in the current dir, which one would you choose to autoload (or equivalently would you prompt the user all the times to choose, or would you just load up the first in the list)?
I think just load up the last stored version for ease, as user probably assume that they'll have only one session to restore under a folder.
Could you expand on what this behaviour is? I do not use neo-tree myself, so I do not know what is expected here.
say i open neo-tree and other buffers and save that session, this plugin will restore the neo-tree buffer also but it should not be stored with other buffers, instead neo-tree buffer should be closed
and open
when restore, check this setting:
config = function()
require("nvim-possession").setup({
pre_save_cmds = { "Neotree action=close" },
post_restore_cmds = { "Neotree action=show" },
})
end,
so above setting will instruct nvim-possession
close neotree before save and then open it when restore --> this is correct way and what i wanted.
the above code won't work as it's not supported currently.
surprisingly this plugin work out-of-box with https://github.com/noib3/nvim-cokeline :thumbup:
from nvim-possession.
I have a work-in-progress branch where I started a caveman implementation for autoload: I am having troubles with treesitter syntax parsing though, it doesn't activate the highlight when buffers are automatically loaded and one must invoke it themselves - not sure why it is so.
If you want to try out the branch notice you must explicitly opt-in the autoload configuration, namely
possession.setup({
autoload = true
})
from nvim-possession.
yes, it worked for me.
from nvim-possession.
for hooks pre_save_cmds
, post_restore_cmds
, you can check its implementation here: https://github.com/rmagatti/auto-session/blob/main/lua/auto-session.lua#L5
i don't understand it much :(
from nvim-possession.
Related Issues (20)
- nvim-tree not loading when restoring a session HOT 9
- Replace "new" and "update" with just "save", buggy when launched at start HOT 7
- About vimscript configuration issues HOT 11
- tag the rockspec with the "neovim" label. HOT 4
- Expose a delete() function HOT 6
- Bad filepath error (No such file or directory) HOT 24
- Files that are deleted still shows in session file. HOT 11
- The autoload setting makes the loaded buffer innactive HOT 1
- How to "close" session? HOT 9
- Breaks on terminal HOT 14
- Bug in README with lualine HOT 2
- Plugin doesn't work HOT 9
- autoload cause double lualine in lazyvim HOT 4
- Close session HOT 9
- Auto-create session path HOT 3
- autoload doesn't work HOT 7
- Add auto save on event, i.e: VimExit? HOT 4
- Switch session will clean up buffers from current session? HOT 8
- Decouple fzf-lua to a plugin? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-possession.