Skip to content

Instantly share code, notes, and snippets.

@seanh
Last active June 12, 2019 22:44
Show Gist options
  • Save seanh/4bf8f757ad23ca1fa28a88830e6a9f89 to your computer and use it in GitHub Desktop.
Save seanh/4bf8f757ad23ca1fa28a88830e6a9f89 to your computer and use it in GitHub Desktop.

Revisions

  1. seanh revised this gist Jun 12, 2019. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions obsession.vim.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    obsession.vim cheatsheet
    ========================

    [obsession.vim](https://github.com/tpope/vim-obsession) is simple, no-hassle Vim sessions from Tim Pope. It's a small plugin
    that just provides `:Obsession`, a better replacement for
    [the standard `:mksession` command](https://jvns.ca/blog/2017/09/10/vim-sessions/).
  2. seanh revised this gist Jun 12, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion obsession.vim.md
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ that just provides `:Obsession`, a better replacement for

    * Has an indicator for your status line, tab line or title string

    * There's an Airline extension for Obsession. Add
    * [Airline](https://github.com/vim-airline/vim-airline) has a builtin extension for Obsession. Add
    `let g:airline#extensions#obsession#enabled = 1` to your vimrc to enable it.
    It just seems to put a `$` in the status line when Obsession is tracking a
    session, doesn't display the name of the session.
  3. seanh revised this gist Jun 12, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion obsession.vim.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ that just provides `:Obsession`, a better replacement for

    Passing a directory doesn't seem to work -- it produced an error from Vim.

    * `:Obsession!` stops recording the current session and deletes it
    * `:Obsession!` stops recording the current session and deletes the session file.

    * To load a previously created session you do `vim -S <path_to_session_file>`
    or `:source <path_to_session_file>` as usual, rather than using the
  4. seanh revised this gist Jun 12, 2019. No changes.
  5. seanh revised this gist Jun 12, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion obsession.vim.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    [obsession.vim](https://github.com/tpope/vim-obsession) is simple, no-hassle Vim sessions from Tim Pope.
    [obsession.vim](https://github.com/tpope/vim-obsession) is simple, no-hassle Vim sessions from Tim Pope. It's a small plugin
    that just provides `:Obsession`, a better replacement for
    [the standard `:mksession` command](https://jvns.ca/blog/2017/09/10/vim-sessions/).

    * Adds the `:Obsession` command:

  6. seanh renamed this gist Jun 12, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. seanh created this gist Jun 12, 2019.
    41 changes: 41 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    [obsession.vim](https://github.com/tpope/vim-obsession) is simple, no-hassle Vim sessions from Tim Pope.

    * Adds the `:Obsession` command:

    * `:Obsession` with no argument creates a `Session.vim` file in the current
    directory and begins session tracking using that file.

    `:Obsession` while a session is already being tracked pauses session
    tracking and `:Obsession` while paused unpauses.

    * `:Obsession <directory_or_filename>` begins tracking a session with the
    given filename as the session file, or a `Session.vim` in the given
    directory. Will create the session file if it doesn't exist.

    Passing a directory doesn't seem to work -- it produced an error from Vim.

    * `:Obsession!` stops recording the current session and deletes it

    * To load a previously created session you do `vim -S <path_to_session_file>`
    or `:source <path_to_session_file>` as usual, rather than using the
    `:Obsession` command. You only use `:Obsession` to create a new session or to
    delete a session.

    If the session file is one created by Obsession, then sourcing it will
    automatically turn on Obsession's automatic session updating.

    * Automatically updates the session file before exiting Vim, and also whenever
    the layout changes (in case Vim crashes)

    * If you try to make a new session on top of an existing session it just lets
    you do it, instead of complaining

    * Has an indicator for your status line, tab line or title string

    * There's an Airline extension for Obsession. Add
    `let g:airline#extensions#obsession#enabled = 1` to your vimrc to enable it.
    It just seems to put a `$` in the status line when Obsession is tracking a
    session, doesn't display the name of the session.

    * If you want the size of your GVim window to also be recorded as part of your
    session add `set sessionoptions+=resize` to your gvimrc.