Skip to content

Commit 5642089

Browse files
committed
Document how to omit hidden & unloaded buffers from session persistence
1 parent 060dea4 commit 5642089

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ Because the vim-session plug-in uses Vim's [:mksession][mksession] command you c
112112
" If you don't want help windows to be restored:
113113
set sessionoptions-=help
114114

115+
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]:
116+
117+
" Don't save hidden and unloaded buffers in sessions.
118+
set sessionoptions-=buffers
119+
115120
Note that the vim-session plug-in automatically and unconditionally executes the following change just before saving a session:
116121

117122
" Don't persist options and mappings because it can corrupt sessions.

doc/session.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,14 @@ how it works by setting |'sessionoptions'| in your |vimrc| script, for example:
280280
" If you don't want help windows to be restored:
281281
set sessionoptions-=help
282282
<
283+
A lot of people don't like Vim's default behavior of saving hidden and unloaded
284+
buffers in sessions (which vim-session inherits due to the use of
285+
|:mksession|). To disable this behavior you can add the following line to your
286+
|vimrc| script:
287+
>
288+
" Don't save hidden and unloaded buffers in sessions.
289+
set sessionoptions-=buffers
290+
<
283291
Note that the vim-session plug-in automatically and unconditionally executes
284292
the following change just before saving a session:
285293
>

0 commit comments

Comments
 (0)