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()
|
function! TryAutosave()
|
||||||
if &autowriteall && &mod && &buftype==""
|
if &autowriteall && &mod && &buftype==""
|
||||||
|
if has("nvim")
|
||||||
|
do BufWritePre
|
||||||
silent write
|
silent write
|
||||||
|
do BufWritePost
|
||||||
|
else
|
||||||
|
silent write
|
||||||
|
end
|
||||||
redraw
|
redraw
|
||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in a new issue