Open poetaman opened 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...
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.
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
.
@mhinz
: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.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.
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.