Vim: write back my file on each key press

前端 未结 6 457
孤街浪徒
孤街浪徒 2020-12-24 08:56

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

6条回答
  •  感情败类
    2020-12-24 09:39

    Whoops! I have been informed I forgot to mention that this usage is in the TODO list, and is "Coming Soon®". I actually wanted this feature a few days ago and discovered it doesn't work yet. Drat!

    use autosave option in .vimrc (_vimrc for windows)

    set autosave=4
    

    This will save your file 4 seconds after the last change. Setting it to one would accomplish what you're looking for. It'll be automatic and always work. (Simpler is better)

    TODO ... evidently I wasn't retaining WHERE I found this when I wrote this answer long ago. Thanks @sehe

提交回复
热议问题