Is there a way to silently run a bash command after a file save in vim?

vim

Solution

I'd suggest using something like syntastic.

To address the explicit question however, you would need to do

au BufWritePost widget.coffee silent !./compile_widget.sh | redraw

The prompt is triggered by the output from the command. The `silent` suppresses the prompt, but when you do that then Vim doesn't redraw the screen after the shell command so that you're able to see the output from the command. So, the `| redraw` forces Vim to redraw the screen.

This is discussed at :help :!

Problem

Right now I'm using the following command to compile a coffeescript file each time I save: ``` au BufWritePost widget.coffee ! ./compile_widget.sh ``` However each time I save I'm asked the following: ``` Press ENTER or type command to continue ``` Is there any way I can save and not have to hit enter to continue?

Original source