How to auto-save a file every 1 second in vim?

user537488 picture user537488 · Aug 9, 2011 · Viewed 11.8k times · Source

I don't want to know about why you should not auto-save or there is swap file etc or whatever reason to not auto-save.

I simply want to auto-save the current working file to save in every 1 second in vim.

How can I achieve this?

Answer

Sameer picture Sameer · Dec 9, 2014

This saves the buffer whenever text is changed. (Vim 7.4)

autocmd TextChanged,TextChangedI <buffer> silent write