Created
June 15, 2022 04:29
-
-
Save unrealapex/272c1adce1da579d57b424f5dd792dfe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" auto save file when it is modified | |
augroup auto_save | |
autocmd! | |
" call save function | |
autocmd BufModifiedSet * call AutoSave() | |
augroup end | |
" save function that is called when buffer is modified | |
function AutoSave() | |
if (bufname() != "" && &buftype == "" && &filetype != "") | |
silent write | |
" prevent empty, readonly, etc... buffers from being saved | |
else | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment