3

This question already has an answer here:

When I run the following command ex:

:! some_command

It's somewhat annoying the message:

Press ENTER or type command to continue

Is there a way to automatically return to current buffer without press ENTER?

marked as duplicate by SibiCoder, EvergreenTree, nobe4, romainl, Tommy A May 28 '16 at 18:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • :help press-enter – romainl May 21 '16 at 16:18
4

A way to do this is to use the silent command:

:silent !ls

This will return to normal mode right after the command (here ls has been executed).

In the case the command produces output, you may want to force a redraw of the screen with the redraw command:

:execute "silent !ls" | redraw!

You can even create a new command that does this for you:

command! -nargs=+ Silent execute 'silent <args>' | redraw!

And use it like so:

:Silent !ls
  • Amazing! @nobe4 – sebelk May 22 '16 at 15:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.