TL;DR: Can Vim store its swap files, and loads the same set of swap files and buffers on load every time?
I'm on a Mac (OS: Maverick), where a number of application keeps the data in some sort of local / out of way storage that's restored between machine restarts / application crashes.
By 'storage', take Sublime Text as an example, as soon as I open a new Tab, it saves the contents of the Tab even if I haven't explicitly saved the Tab as a file for permanent storage anywhere. So if I were to close down ST and reopen it (or it / machine crashes), it would restore all of the Tabs & content that I had before the closure.
This sort of fool-proof content retention (TM) can be seen across a number of Mac Applications (e.g. iMovie, QuickTime Player, TextEdit, etc), and is in line with Mac's design philosophy of always letting the user continue where they left off - without having to save anything explicitly.
Given the fact that:
1. Vim keeps swap files and updates every 200 strokes / 4 seconds of inactivity to
2. Vim has startup options that allow files / swap to be opened
there's sufficient foundation here for me to wonder if Vim / MacVim doesn't have this content retention (TM) feature already amongst it's hundreds of configuration options?
p.s. I currently use vim-sessions, purely for 'project like file grouping', but it does not retain contents for unsaved buffers
p.p.s. been playing with the
:preserve option and
cpoptions+=& in .vimrc. Doesn't seem to have impact, swap files are still deleted on MacVim closes, and nothing is opened when MacVim starts again