Is there a way to quietly run the bash command after saving the file in vim?

Now I use the following command to compile the coffeescript file every time I save:

au BufWritePost widget.coffee ! ./compile_widget.sh 

However, each time I save, they ask me the following:

 Press ENTER or type command to continue 

Is there a way to save and not press Enter to continue?

+8
vim
source share
2 answers

I would suggest using something like syntastic .

To solve the explicit question, you will need to do

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

The invitation starts as a result of the output of the command. silent suppresses the prompt, but when you do this, Vim does not redraw the screen after the shell command so that you can see the result from the command. Thus, | redraw | redraw forces Vim to redraw the screen.

This is discussed in : help :!

+6
source share

You are doing it wrong. You should not ask Wim about this. You should learn Guard , watchr, or other tools that look at the disc and its subject.

0
source share

All Articles