How to have VIM automatically log files that were changed in a logfile?
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.
精彩评论