mhinz / vim-startify

:link: The fancy start screen for Vim.
MIT License
5.31k stars 186 forks source link

Tabbed session support #468

Open poetaman opened 3 years ago

poetaman commented 3 years ago

I used to use https://github.com/xolox/vim-session, before I started using Startify's :S* commands to manage sessions.

One benefit of vim-session is their tab scoped sessions: https://github.com/xolox/vim-session#tab-scoped-sessions. That allows opening sessions in a new tab, and closing it would just close the session of that tab & its buffers. One can then then move to other tabs to keep working.

1) Add tabbed session support to Startify, so opening/closing a session in one Vim tab does not affect other tabs. Perhaps you could just use their implementation.

2) Give users a hook to specify custom command/function for "Sessions" on startify page. The hook will default to using the session management functions built into Startify.

mhinz commented 3 years ago

My biggest regret with Startify is that people mistake it for a session management plugin. :-) But that's my fault. Initially, :SSave was only added to save sessions in one known directory, so they could be easily listed in the startify buffer. And then I gave in to feature requests too often. Anyway...

  1. I'm not sure what exactly is needed here. The buffer list is global anyway, so each opened buffer can be accessed from any tab. Tabs are really just different views into the buffer list. So.. just using :tabnew before sourcing the session would be good enough? Disclaimer: I do not use sessions.

  2. Could 1. be solved by using such a hook? I'm thinking about a more generic way to define such actions already. E.g. there is another issue of someone who wants to open bookmarks with NERDTree, if they're directories, instead of the default :edit.

poetaman commented 3 years ago

@mhinz

  1. :tabnew before sourcing session is good enough. Though while closing the session, we will only close the current tab. And make sure that instead of closing all buffers, we will close only the ones which are not open in other tabs.
  2. A hook will not solve this by itself, but give users ability to call session management functions in other plugins. Though IMO, your implementation looks simple & clean, adding just one tab feature I mention above should make sessions more practical (right now opening a session means all the current splits and windows, etc are lost).

Also, I for now have implemented the NERDTree feature you mention, though using funcref type (instead of builtin bookmark type). IMO, the most powerful type you have in your plugin is funcref type, anything can be done with it, and its already documented... Though the interface could be cleaner (function of funcref returns a list, corresponding 'indices' are in a separate list; that makes it slightly unreadable), but no complaints, this plugin is already a great upgrade to working with vim.