neovim-session-manager icon indicating copy to clipboard operation
neovim-session-manager copied to clipboard

Current session identifier

Open venzen opened this issue 3 years ago • 3 comments

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.

venzen avatar Feb 22 '22 03:02 venzen

Makes sense. But I would provide it as a lua function, easier to use.

Shatur avatar Feb 22 '22 08:02 Shatur

same, it would be extremely nice if it has the abilities to name sessions

AquaticBUBU avatar Apr 30 '22 17:04 AquaticBUBU

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
})

bennypowers avatar Jun 03 '22 10:06 bennypowers