I\'d like vim to automatically write my file as often as possible. The ideal would be every keystroke.
I need to save regularly so that my background build process wi
I suggest using the method I described in similar Save file after each edit in vim question:
The CursorHold and CursorHoldI might help. According to docs:
|CursorHold| the user doesn't press a key for a while
|CursorHoldI| the user doesn't press a key for a while in Insert mode
Those events fire only once after inactivity and depend on updatetime variable (default: 4000ms). So you can:
:au CursorHold :update
Which will update current buffer file (i.e. save only if modified) after default 4 seconds of inactivity in Normal mode.
Add autocommand for CursorHoldI if you want to get the same behavior in Insert mode.
Setting CursorHold, CursorHoldI events along with very short updatetime will make vim save the file instantly after the edit.