Autosave for VIM

I believe that it’s a good idea that vi does not auto save during editing. Think of config files or src files that should never be in an inconsistent state. The programmer or sysadmin should decide when he wants to save data.

But sometime auto save is handy, while typing lists like todo lists or outlines etc. Every version is OK and you don’t want to save after every change and still don’t want to loos data on connection or power loss.

Use this in you current VIM session to make this current buffer autosave:

:au TextChanged,TextChangedI <buffer> silent w