File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -442,12 +442,17 @@ function! xolox#session#auto_save() " {{{2
442
442
" We won't save the session if auto-save is explicitly disabled.
443
443
return
444
444
endif
445
- " Get the name of the active session (if any).
446
- let name = xolox#session#find_current_session ()
447
- " If no session is active and the user doesn't have any sessions yet, help
448
- " them get started by suggesting to create the default session.
449
- if empty (name) && (empty (xolox#session#get_names ()) || g: session_default_overwrite )
450
- let name = g: session_default_name
445
+ if empty (g: session_autosave_to )
446
+ " Get the name of the active session (if any).
447
+ let name = xolox#session#find_current_session ()
448
+ " If no session is active and the user doesn't have any sessions yet, help
449
+ " them get started by suggesting to create the default session.
450
+ if empty (name) && (empty (xolox#session#get_names ()) || g: session_default_overwrite )
451
+ let name = g: session_default_name
452
+ endif
453
+ " Prompt the user to save the active/first/default session?
454
+ else
455
+ let name = g: session_autosave_to
451
456
endif
452
457
" Prompt the user to save the active/first/default session?
453
458
if ! empty (name)
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ Contents ~
25
25
5. The | g:session_extension | option
26
26
6. The | g:session_autoload | option
27
27
7. The | g:session_autosave | option
28
+ 7. The | g:session_autosave_to | option
28
29
8. The | g:session_autosave_periodic | option
29
30
9. The | g:session_verbose_messages | option
30
31
10. The | g:session_default_to_last | option
@@ -337,6 +338,16 @@ to your session. Set this option to "'yes'" to always automatically save open
337
338
sessions when you quit Vim. To completely disable automatic saving you can set
338
339
this option to "'no' ".
339
340
341
+ -------------------------------------------------------------------------------
342
+ The *g:session_autosave_to* option
343
+
344
+ If | g:session_autosave | equals "'yes' " and this option is different from "''",
345
+ autosave always autosaves to a session with name | g:session_autosave_to | regardless
346
+ of what the current session is or any other options. In particular,
347
+ | g:session_default_overwrite | does not have any effect. If "''", autosave saves to
348
+ the session name that would be used if this option did not exist. The default
349
+ value is "''".
350
+
340
351
-------------------------------------------------------------------------------
341
352
The *g:session_autosave_periodic* option
342
353
You can’t perform that action at this time.
0 commit comments