Run autocommands on autosave in neovim
This commit is contained in:
parent
265e3a4ba6
commit
1af4a1aaae
1 changed files with 7 additions and 1 deletions
|
@ -2,7 +2,13 @@
|
|||
|
||||
function! TryAutosave()
|
||||
if &autowriteall && &mod && &buftype==""
|
||||
silent write
|
||||
if has("nvim")
|
||||
do BufWritePre
|
||||
silent write
|
||||
do BufWritePost
|
||||
else
|
||||
silent write
|
||||
end
|
||||
redraw
|
||||
end
|
||||
endfunction
|
||||
|
|
Loading…
Reference in a new issue