在Vim中使用自动保存而不使用插件?

问题描述 投票:0回答:1

如何不使用插件自动保存在Vim中?

我发现了以下帖子:

Auto-save in VIM as you type

给出以下答案:

autocmd TextChanged,TextChangedI <buffer> silent write

效果很好,只是当我将其放入.vimrc时不起作用,所以我如何将该行放入.vimrc以便每次打开Vim都可以起作用?

vim
1个回答
1
投票

D. Ben Knoble的注释中所述,您需要使用*而不是<buffer>

autocmd TextChanged,TextChangedI * silent write
© www.soinside.com 2019 - 2024. All rights reserved.