Save/load session in vim

I never realize I can save or/and load session inside vim. This is a super handy feature if you want to switch gear after a long and work on something else for a moment then come back. Bonus tip: If you are already using screen, you can simply detach and attach the current screen or open up a new tab.

To create a session

  :mksession mysession.vim

To restore a session,

  :source mysession.vim
  vim -S mysession.vim

By the way, you can always use :wall or :wa to save all changes in buffer before doing any thing crazy.

^ Top of Page