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

Viewed 14489

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?

4 Answers

For Readers in 2021 and You're using CoC.nvim Plugin

Use this which is compatible to Coc.nvim:

autocmd InsertLeave * if &readonly==0 && filereadable(bufname('%')) \
                       | silent update | endif

The accepted answer will cause the autocompletion fails.

Peace.


Showing some UI to prove I love (neo)Vim(-nightly): (Clickable, many others see my profile intro.)

Related