Add autosave environment variable check in vim
This commit is contained in:
parent
f2598c47fb
commit
d490d3ce2d
1 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,10 @@ function! TryAutosave()
|
||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
if exists("$AUTOSAVE")
|
||||||
|
set autowriteall
|
||||||
|
end
|
||||||
|
|
||||||
augroup autosave
|
augroup autosave
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufLeave * call TryAutosave()
|
autocmd BufLeave * call TryAutosave()
|
||||||
|
|
Loading…
Reference in a new issue