Closed llinfeng closed 5 years ago
Sorry, but I almost never use Windows and never used WSL so far.
The way sessions are saved can be influenced with :h 'ssop'
. It mentions:
"slash" and "unix" are useful on Windows when sharing session files
with Unix. The Unix version of Vim cannot source dos format scripts,
but the Windows version of Vim can source unix format scripts.
You probably have to play around with these values.
If you ever need to change where Startify saves sessions, use :h g:startify_session_dir
. Maybe use different values for Win and Ubuntu. (Although that should be the default for both OS, but then again I have no idea how WSL really works.)
Thank you for pointing out that I shall tell Startify to source different startify_session_dir
. Indeed, WSL has its own set of ~/.vimrc
files, and I can thus direct Startify to source a different folder for WSL. And, here goes a few good reasons for leaving the session files native to the file-system:
fileA
to be differentHowever, here go a few observation that I see as opportu nities to have a saved-session shareable across OS/build:
edit Nutstore/Research/BEE_Lab/homepage/ref.md
edit $PC_Home/Nutstore/Research/BEE_Lab/homepage/ref.md
fileformat
when saving the Startify session. As long as we can force set ff=unix
per each saving attempt, the saved "session file" could be used by whatever OS?PS: per my understanding of how sessions are saved, I call files that I store in startify_session_dir
as "session files".
Except for 'sessionoptions'
I can't influence how sessions get saved.
It's not guaranteed that the session file used a relative path as in your example. For both points you mentioned one would have to open/edit/save/close them again. That would always be an ugly hack.
This approach would have many corner cases and I consider this use case uncommon enough so that it doesn't warrant the time for new code. The cost-benefit isn't worthwhile here.
Especially since this plugin is not a full-fledged plugin for managing sessions. It provides a start screen and its session saving capabilities are just a way to easily save all sessions to the same directory, so that Startify can list them in the start screen.
Thanks for bringing this up anyway! ✨
My daily driver is a Windows 10 machine, and I am experimenting the "Windows Subsystem for Linux" on it. I have got
ubuntu.exe
installed, and have made Vim to source its configuration files (*.vim
) from the Windows OS.Cannot open Windows-saved sessions on Ubuntu-Vim
Now, I get the following error when I try to load existing sessions from Startify when I am in the Vim hosted by "Ubuntu on Windows":
Please advise what to specify when it comes to how Vim saves these views.
Cannot open Ubuntu-saved session on Windows-Gvim
I have also tried to save a Startify session on the Ubuntu-vim, and it worked well: I can save and load it within the Ubuntu Vim environment. Yet, I got the following error when trying to load such "Ubuntu-saved" session on Windows-Gvim
Observation
It is clear that the sessions saved by each OS are OS-specific:
One way to live with the restrictions is to name the sessions strategiclly, by creating
u_Project1
sessions for Ubuntu-Vim specifically.Looking forward to a way to summon the sessions irrespective of the OS.