Bryan Grohman

All Writing

Vim Sessions


IDEs like IntelliJ and Eclipse have a nice feature where they will automatically save your session when you close the IDE and restore it on the next startup.

You can do this with Vim, too, with the built-in :mksession command. The :mksession command will write a Vim script file containing commands to restore the current session. Use the :source <session-file> command to restore from a saved session. For the full details and list of options, read the :help mksession Vim documentation.

I wanted a little more session functionality, so I wrote a small Vim plugin to help manage my sessions called vim-bg-sessions.

Vim bg-sessions Plugin

This plugin provides commands for saving, restoring, listing, and deleting sessions by name with tab autocompletion. It also automatically saves your session when you quit Vim.

Full documentation is available on the plugin's GitHub page.