neovim-session-manager
neovim-session-manager copied to clipboard
Current session identifier
Describe the problem or limitation you are having
When starting nvim with Session Manager set to autoload the last session (or when switching sessions often) it is not immediately apparent what the current session is.
Describe the solution you'd like
It would be useful to have a global variable that contains the name/path of the current session. It can be called via :SessionManager current_session_name
and then easily included in lualine or another status bar.
Additional context
The enhancement of also having customizable session names (as discussed in #27) would help to make the current_session_name
easily identifiable.
Makes sense. But I would provide it as a lua function, easier to use.
same, it would be extremely nice if it has the abilities to name sessions
This would also be helpful for things like startup dashboards:
---Launch alpha if vim starts with only empty buffers
--
autocmd('VimEnter', {
group = augroup('alpha_on_startup', { clear = false }),
pattern = '*',
callback = function()
local is_buffer_active = U.has_non_empty_buffers()
local session_name = require 'session_manager.utils'.get_current_session_name()
if (not is_buffer_active) and (not session_name) then
vim.cmd [[ :Alpha ]]
end
end
})