" Setup swap/backup/undo
" Note that as of vim 7.4, backupdir // will not expand backup files to a full
" path as is the case with directory and undodir.
-let s:dir = expand(has('win32') ? '~/Application Data/Vim' : has('mac') ?
- \ '~/Library/Vim' : '~/.local/share/vim')
-execute 'set directory^=' . s:dir . '/swap//'
+let s:dir = expand(has('win32') ? '$HOME/vimfiles' : '$HOME/.vim')
if !isdirectory(s:dir . '/')
call mkdir(s:dir)
endif
if !isdirectory(s:dir . '/undo/')
call mkdir(s:dir . '/undo')
endif
+execute 'set directory^=' . s:dir . '/swap//'
if isdirectory(s:dir . '/backup/')
execute 'set backupdir=' . s:dir . '/backup//'
set backup