Vim has a built-in session mechanism, from
A Session keeps the Views for all windows, plus the global settings. You can
save a Session and when you restore it later the window layout looks the same.
You can use a Session to quickly switch between different projects,
automatically loading the files you were last working on in that project.
It should fill your 2 first requirements but the third one
Sublime Text even remembers changes to unsaved files isn't supported out of the box.
To save your sessions you need to use
:h :mksession). By default the command will save the file in
~/Session.vim but you can provide a file path as argument or modify the default behavior with
To reload your session use
:source ~/Session.vim (or whatever filepath you used with
Note that you need Vim to be compiled with the
+mksession feature to use the sessions.
Finally to automate the process you can add this to your vimrc:
" Automatically save the session when leaving Vim
autocmd! VimLeave * mksession
" Automatically load the session when entering vim
autocmd! VimEnter * source ~/Session.vim