To run "command" on the current file on each save, use: :autocmd BufWritePost * !command is a built-in variable for the current active file.