4

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?

sebelk
  • 325
  • 2
  • 10

1 Answers1

5

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
nobe4
  • 16,033
  • 4
  • 48
  • 81