From e5450e92bd80e6cccff50962fbfc60cc66c60f92 Mon Sep 17 00:00:00 2001 From: Thaer Khawaja Date: Sun, 13 Aug 2017 14:32:14 -0700 Subject: [PATCH] When autosave is enabled, pull swap functionality by default. --- plugin/workspace.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/workspace.vim b/plugin/workspace.vim index 55b57ed..6a7c168 100644 --- a/plugin/workspace.vim +++ b/plugin/workspace.vim @@ -148,9 +148,13 @@ function! s:SetAutosave(enable) if a:enable == 1 let s:autoread = &autoread let s:autowriteall = &autowriteall + let s:swapfile = &swapfile + let s:swapsync = &swapsync let s:updatetime = &updatetime set autoread set autowriteall + set noswapfile + set swapsync="" set updatetime=1000 augroup WorkspaceToggle au! BufLeave,FocusLost,FocusGained,InsertLeave * call s:Autosave(0) @@ -162,6 +166,8 @@ function! s:SetAutosave(enable) let &autoread = s:autoread let &autowriteall = s:autowriteall let &updatetime = s:updatetime + let &swapfile = s:swapfile + let &swapsync = s:swapsync au! WorkspaceToggle * * let s:autosave_on = 0 endif