Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto_save_to option added #81

Merged
merged 1 commit into from
Jul 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions autoload/xolox/session.vim
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,17 @@ function! xolox#session#auto_save() " {{{2
" We won't save the session if auto-save is explicitly disabled.
return
endif
" Get the name of the active session (if any).
let name = xolox#session#find_current_session()
" If no session is active and the user doesn't have any sessions yet, help
" them get started by suggesting to create the default session.
if empty(name) && (empty(xolox#session#get_names()) || g:session_default_overwrite)
let name = g:session_default_name
if empty(g:session_autosave_to)
" Get the name of the active session (if any).
let name = xolox#session#find_current_session()
" If no session is active and the user doesn't have any sessions yet, help
" them get started by suggesting to create the default session.
if empty(name) && (empty(xolox#session#get_names()) || g:session_default_overwrite)
let name = g:session_default_name
endif
" Prompt the user to save the active/first/default session?
else
let name = g:session_autosave_to
endif
" Prompt the user to save the active/first/default session?
if !empty(name)
Expand Down
11 changes: 11 additions & 0 deletions doc/session.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Contents ~
5. The |g:session_extension| option
6. The |g:session_autoload| option
7. The |g:session_autosave| option
7. The |g:session_autosave_to| option
8. The |g:session_autosave_periodic| option
9. The |g:session_verbose_messages| option
10. The |g:session_default_to_last| option
Expand Down Expand Up @@ -337,6 +338,16 @@ to your session. Set this option to "'yes'" to always automatically save open
sessions when you quit Vim. To completely disable automatic saving you can set
this option to "'no'".

-------------------------------------------------------------------------------
The *g:session_autosave_to* option

If |g:session_autosave| equals "'yes'" and this option is different from "''",
autosave always autosaves to a session with name |g:session_autosave_to| regardless
of what the current session is or any other options. In particular,
|g:session_default_overwrite| does not have any effect. If "''", autosave saves to
the session name that would be used if this option did not exist. The default
value is "''".

-------------------------------------------------------------------------------
The *g:session_autosave_periodic* option

Expand Down