Vim: write back my file on each key press

前端 未结 6 458
孤街浪徒
孤街浪徒 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:47

    These hacks are not needed any more. Vim can automatically write a file to disk whenever it is changed. Just add this to your $MYVIMRC:

    autocmd TextChanged,TextChangedI write

    I believe you need Vim 7.4. In contrast to autosave=1, this will save your file as soon as you change it.

提交回复
热议问题