VIM: File Autosave
I was wondering how to save file in VIM automatically. Found some solutions in internet but decided to do it my way. So I wrote this small solution: """ Save file on each edit exit function FileAutoSave() if exists('g:file_autosave_async') return endif if @% == "" return elseif !filewritable(@%) return endif let g:file_autosave_async = 1 call timer_start(500, 'FileAutoSaveAsync', {'repeat': 1}) endfunction function FileAutoSaveAsync(timer) update unlet g:file_autosave_async endfunction :autocmd InsertLeave,TextChanged * call FileAutoSave() """ It updates file in two cases:...