May 2018
Intermediate to advanced
168 pages
4h 2m
English
| Tip 23 | Saving and Restoring Sessions |
Sometimes you have to restart Vim. Usually this means losing your list of open buffers, as well as any open tab pages or windows. Fortunately, Vim’s session management allows you to save your current workspace so that you can restore it again later.
The source code that accompanies this book includes a webapp directory. Switch to that directory and launch Vim, using the -O flag to open the specified files in vertical splits:
| => | $ cd code/webapp |
| => | $ vim -O app.js test/app-test.js |
You should see the app.js and app-test.js files in adjacent windows. Now use the :mksession! command to save the session (:h :mksession):
| => | :mksession! |
Vim records the current session ...