开发者

How to have VIM automatically log files that were changed in a logfile?

开发者 https://www.devze.com 2023-02-14 05:03 出处:网络
Is there anyway to hook into vim\'s file save action to have it automatically write a log file the name of any开发者_开发知识库 file that has been changed?Yes, there is. It\'s a feature called autocom

Is there anyway to hook into vim's file save action to have it automatically write a log file the name of any开发者_开发知识库 file that has been changed?


Yes, there is. It's a feature called autocommands. Type :help :autocmd to access the documentation. You probably want something like this:

:autocmd BufWrite * <command that appends to log>

You can use % as a placeholder for the current file name.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号