2

I can dump the output content from my external command in the main window, I can disable "Press ENTER or type command to continue" and simply store it in a register.

But how do I call an external command in vim (it can be any program, apt-get, etc) and simply avoid it creating a buffer window if an output? Simply IGNORE the output from a external command I ran? I just want to call the command from vim. The command starts a simple webserver (listening on port 8080) and I have to press ctrl+c to stop it and move away from the external command buffer.

I tried silent before !cmd, it works, but I would like to stop the process my external command created right after it was started.

EDIT: I changed my mind about the simple webserver. I another situations, just doing like the suggestion accepted answer it works.

Community
  • 1
  • 1

1 Answers1

3

Pipe output to /dev/null:

:!cmd &> /dev/null

Use silent as you mention to get rid of the Press ENTER or type command to continue:

:silent !cmd &> /dev/null

Read this page for more on hiding this message.

moinudin
  • 134,091
  • 45
  • 190
  • 216
  • I've updated my question, it starts a process in background, how to I stop it right after I started? Your suggestion is going to help me in another problem I had, thanks anyway. – Somebody still uses you MS-DOS Dec 23 '10 at 17:14
  • @Somebody When you say you would like to "stop the process", do you perhaps mean backgrounding the process? i.e. append an & after the cmd? – moinudin Dec 23 '10 at 17:15
  • I think I'm doing the wrong approach and need to understand some concepts. The command starts a webserver and listens to a port. It doesn't make much sense what I'm doing as I've come to realize it, but your response indeed works to achieve what I'm asking in my question: ignore an output. – Somebody still uses you MS-DOS Dec 23 '10 at 17:25
  • I've found a source with some good explanation about background process and your solution, I think you could edit your answer with it's information: http://newsgroups.derkeiler.com/Archive/Comp/comp.editors/2006-08/msg00453.html Thanks! – Somebody still uses you MS-DOS Dec 23 '10 at 17:28