Giter VIP home page Giter VIP logo

sessionman.vim's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=2010

Vim provides a ':mksession' command to save the current editing session.  This plug-in helps to work with Vim sessions by keeping them in the dedicated location and by providing commands to list all sessions, open session, open last session, close session, save session and show last session.  From a list of sessions you can open session, delete session, edit session and edit extra session script.  Please note that session name can contain spaces and does not have to have a .vim extension.

On Windows, DOS and OS2 sessions are saved in:
  "$HOME/vimfiles/sessions"   if $HOME is defined
  "$APPDATA/Vim/sessions"     if $APPDATA is defined
  "$VIM/sessions"             otherwise
On Unix sessions are saved in:
  "$HOME/.vim/sessions"
If this directory does not exist, it will be created by the :SessionSave command (requires Vim 7).

At the top of the window there is a help that shows normal mode mappings:
  q                        - close session list
  o, <CR>, <2-LeftMouse>   - open session
  d                        - delete session
  e                        - edit session
  x                        - edit extra session script
The name of an opened session is saved in g:LAST_SESSION variable which is saved in the viminfo file if 'viminfo' option contains '!'.  It is used to open last session by :SessionOpenLast command.  It can be done when Vim starts (gvim +bd -c SessionOpenLast) or any time during a Vim session.  You can edit an extra session script to specify additional settings and actions associated with a given session.  If you change values of 'expandtab', 'tabstop' or 'shiftwidth', they will be restored to their original values when session is closed or before a new session is opened.  When session is opened and 'cscope' is enabled, script calls 'cscope add' for the current directory so make sure it is set correctly for the session.

:SessionOpen command takes a session name as an argument.  It supports argument completion.

:SessionOpenLast command opens the g:LAST_SESSION session (see above).

:SessionClose command wipes out all buffers, kills cscope and clears variables with session name.

:SessionSave command saves the current editing session.  If v:this_session is empty it asks for a session name.

:SessionSaveAs command takes a session name as an optional argument.  If there is no argument or it is empty, it asks for a session name (default is the last part of v:this_session).

:SessionShowLast command shows the content of the g:LAST_SESSION and v:this_session variables.

If 'sessionman_save_on_exit != 0' (default) then the current editing session will be automatically saved when you exit Vim.

Plug-in creates a "Sessions" sub-menu under the "File" menu.

sessionman.vim's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.