Shatur / neovim-session-manager

A simple wrapper around :mksession.
GNU General Public License v3.0
530 stars 52 forks source link

Limit number of sessions with LoadSession #120

Open NoahTheDuke opened 6 months ago

NoahTheDuke commented 6 months ago

Describe the problem or limitation you are having When I use "Load Session" from :SessionManager, it lists all of my saved sessions. I currently have 57 of them on my machine, which means I can't input a session number until I've scrolled to the end of the list. This means if the session I'm looking for is one of first, I have to remember to look for it before scrolling to the end. This is cumbersome and leads to errors when I forget about the scrolling behavior.

Describe the solution you'd like I'd like to have a config option for setting a display limit of sessions. Maybe the most recent 10 or 20 or whatever. It could default to nil aka all of them, but having some method of limiting would be helpful for me.

Describe alternatives you've considered

  1. Do nothing. The current behavior is good actually, and I should get over it.
  2. Change the way the sessions are displayed so scrolling isn't so annoying (in a new buffer, pop up window, etc).
  3. Add a new option for "Load Latest Sessions" that only displays N most recent sessions.

Additional context

Screen Shot 2024-05-17 at 10 38 08 AM Screen Shot 2024-05-17 at 10 38 32 AM
Shatur commented 6 months ago

I agree with the suggestion. Maybe we should even delete oldest sessions.