【发布时间】:2018-04-05 14:48:05
【问题描述】:
我想使用 indent linux 实用程序在保存时缩进当前文件。我试过了
autocmd BufWritePre *.[ch] :!indent -kr -nut %
在我的 .vimrc 文件 (~/.vim) 中。
我手动尝试了该命令
:!indent -kr -nut %
只有在提示我加载文件后才有效,如下所示,
See ":help W12" for more info.
[O]K, (L)oad File:
【问题讨论】:
-
autocmd BufWritePost *.[ch] :!indent -kr -nut % 有效,但仍要求类似于手动命令的加载文件