jpmorn
2019-03-27 12:59:43 +08:00
给个 vim 设置 lost focus autosave 的配置
"===[ save if lost focus] ===
au FocusLost * silent! update
set autowriteall
"===[ Persistent undo ]===
" Put plugins and dictionaries in this dir (also on Windows)
let vimDir = '$HOME/.vim'
let &runtimepath.=','.vimDir
" Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = expand(vimDir . '/undodir')
" Create dirs
call system('mkdir ' . vimDir)
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
endif