Vim plugin for working with sessions
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
autoload
plugin
LICENSE
README.md
screenshot.gif

README.md

vim-bg-sessions

Vim plugin for saving and loading sessions

Issue Count

Features

  1. Save and load sessions by name.
  2. Tab autocompletion of session names when saving or loading sessions.
  3. Automatically save the "latest" version of a named session while keeping the original session intact.
  4. Delete sessions by name.
  5. Automatically save your session whenever you quit Vim using a session named "last".

Screenshot

Installation

Install vim-bg-sessions like you would any other Vim plugin.

For Pathogen:

cd ~/.vim/bundles
git clone https://github.com/bgrohman/vim-bg-sessions.git

Usage

Commands

:Sessions

Lists all saved sessions.

:SaveSession [session_name]

Saves your current sessions. If session_name is provided, a session will be saved with that name. Otherwise, the session will be saved with the name of "last".

When saving a named session, the "last" session is also updated.

Use tab for session name autocompletion.

Example: Save a session named "myFirstSession"

:SaveSession myFirstSession

:LoadSession [session_name]

Loads a session. If session_name is provided, the session by that name will be loaded. Otherwise, the session named "last" will be loaded. Use tab for session name autocompletion.

Example: Load a session named "myFirstSession"

:LoadSession myFirstSession

Example: Load your last session from the last time you closed Vim

:LoadSession

or

:LoadSession last

Example: Load the "latest" version of a session named "myFirstSession"

You've saved a session named "myProject" for a particular project, and you want to be able to always return to that session, so you don't re-save it after continuing your work (e.g. opening additional buffers/windows/tabs). But you also want to be able to return to your last state after you loaded that session, including all of the changes since the "myProject" session was loaded. This plugin will automatically save a session named "myProject_latest" any time you enter a new buffer.

:LoadSession myFirstSession_latest

:DeleteSession session_name

Deletes the session named session_name. Use tab for session name autocompletion.

Example: Delete a session named "myFirstSession"

:DeleteSession myFirstSession

Options

Saved Session Directory

Session files are stored in the directory provided by the global variable g:bg_sessions_dir which is set to "~/.vim-sessions" by default.