Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是因为我想在每个文件保存后自动运行测试。
我看过autocmd但BufWritePost不能让它工作。
autocmd
BufWritePost
这run_tests.sh在保存任何文件后运行,当前文件名作为唯一参数:
run_tests.sh
:autocmd BufWritePost * !run_tests.sh <afile>
查看自动命令:
:autocmd BufWritePost *
并删除以前的所有自动命令:
:autocmd! BufWritePost *