Enable again swapfiles, fixes #638

This commit is contained in:
Adam Stankiewicz
2020-12-30 09:58:20 +01:00
parent 6783bd0df9
commit e5668602cc

View File

@@ -2687,8 +2687,25 @@ if !has_key(g:polyglot_is_disabled, 'sensible')
" Reload unchanged files automatically. " Reload unchanged files automatically.
set autoread set autoread
" Disable swap, it doesn't play well with autoread " This is needed to avoid swapfile warning when auto-reloading
set noswapfile set shortmess+=A
" Avoids swapfiles in current directory
if &directory =~# '^\.,'
if !empty($HOME)
if has('win32')
let &directory = expand('$HOME/vimfiles') . '//,' . &directory
else
let &directory = expand('$HOME/.vim') . '//,' . &directory
endif
endif
if !empty($XDG_DATA_HOME)
let &directory = expand('$XDG_DATA_HOME') . '//,' . &directory
endif
if has('macunix')
let &directory = expand('$HOME/Library/Autosave Information') . '//,' . &directory
endif
endif
" Autoindent when starting new line, or using `o` or `O`. " Autoindent when starting new line, or using `o` or `O`.
set autoindent set autoindent