auto-session
auto-session copied to clipboard
[FEATURE] Add a hook for when no session is restored, like nvim .
Is your feature request related to a problem? Please describe. I use Alpha.nvim, and I never see it, so if the hook exists I could use Alpha.nvim or any other dashboard
Describe the solution you'd like
A CMD hook like no_session_cmd
Describe alternatives you've considered None
Additional context
also if anyone knows why there is a moon emoji pls tell me, that would be nice :P
btw the screenshots I provided are the expected behaviour, I just simulated it.
Interesting idea. What would you like to do as an example when no session is restored?
Open the dashboard. I am sure there would be a lot of cool ideas but I can not come up with more.
I ended up creating an alias v-="echo '' | nvim" to open the alpha, but it would be nice to also be able to drop into the dashboard if an error occurs.
also if anyone knows why there is a moon emoji pls tell me, that would be nice :P
This is your shell prompt showing that you're in a directory containing Lua files.
I've experienced this too when using Alpha.nvim. By design, on neovim startup auto-session restores and loads the buffer/etc from the last session if there is one, effectively skipping any user installed dashboard that would normally show on nvim startup.
This is definitely intended behavior. If you want to get "back" to the dashboard I'd recommend either deleting your session, or creating a keymap that allows you to pull the dashboard up whenever you like.
However, when a session ends with Alpha dashboard loaded, upon restore it does not properly render the dashboard, instead it renders an empty buffer. There might be room for improvement here.
Added. Example setup
require("auto-session").setup {
log_level = vim.log.levels.DEBUG,
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
auto_session_use_git_branch = false,
no_restore_cmds = {
function()
vim.notify("!!!WASABI!!!", vim.log.levels.DEBUG)
end
}
}