chustar
chustar

Reputation: 12465

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?

Upvotes: 1

Views: 369

Answers (1)

R. Martinho Fernandes
R. Martinho Fernandes

Reputation: 234654

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.

Upvotes: 3

Related Questions