Skip to content

Commit

Permalink
Document how to omit hidden & unloaded buffers from session persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Sep 2, 2015
1 parent 060dea4 commit 5642089
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ Because the vim-session plug-in uses Vim's [:mksession][mksession] command you c
" If you don't want help windows to be restored:
set sessionoptions-=help

A lot of people don't like Vim's default behavior of saving hidden and unloaded buffers in sessions (which vim-session inherits due to the use of [:mksession][mksession]). To disable this behavior you can add the following line to your [vimrc script] [vimrc]:

" Don't save hidden and unloaded buffers in sessions.
set sessionoptions-=buffers

Note that the vim-session plug-in automatically and unconditionally executes the following change just before saving a session:

" Don't persist options and mappings because it can corrupt sessions.
Expand Down
8 changes: 8 additions & 0 deletions doc/session.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@ how it works by setting |'sessionoptions'| in your |vimrc| script, for example:
" If you don't want help windows to be restored:
set sessionoptions-=help
<
A lot of people don't like Vim's default behavior of saving hidden and unloaded
buffers in sessions (which vim-session inherits due to the use of
|:mksession|). To disable this behavior you can add the following line to your
|vimrc| script:
>
" Don't save hidden and unloaded buffers in sessions.
set sessionoptions-=buffers
<
Note that the vim-session plug-in automatically and unconditionally executes
the following change just before saving a session:
>
Expand Down

0 comments on commit 5642089

Please sign in to comment.