tags:

views:

1857

answers:

3

Is there any way to disable the "Press ENTER or type command to continue" prompt that appears after executing an external command?

EDIT: Found a workaround: Add an extra <CR> to the shortcut in my .lvimrc.

map <F5> :wall!<CR>:!sbcl --load foo.cl<CR><CR>

Any better ideas?

+4  A: 

I'm not sure how to do it globally though for one command:

:silent!<command>
Wergan
Unfortunately not very helpful for me, it messes up the screen and I have to press Ctrl-L... which is even more annoying than pressing space.
kotlinski
Worked for my grep script though!
Mikko Rantanen
+4  A: 
:help hit-enter
anthony
I'm curious as to why someone voted this answer down, since `:help hit-enter` provides some fairly useful background information on "Press ENTER..." prompt. Care to explain?
Curt Sampson
What information from ':help hit-enter' answers the question? I can't find it.
kotlinski
It is possible you could get a "Press ENTER" prompt from the write all command before you shell out. The information under <code>shortmess</code> which <code>hit-enter</code> links to is valid in that case. However, the prompt you are getting is from shelling out, so Wergan's suggestion is the correct one. As noted in <code>:help :silent</code> "When using this for an external command, this may cause the screen to be messed up. Use |CTRL-L| to clean it up". You can add :redraw or Ctrl-L to your command to fix that. Or just do the two returns you're already doing.
Conspicuous Compiler
+1  A: 

This is how I dealt with the problem that running an external program through silent messes up the screen in text-mode vim (in my experience, gvim doesn't suffer from this problem):

command! -nargs=1 Silent
\ | execute ':silent !'.<q-args>
\ | execute ':redraw!'

Use it instead of the regular silent command:

:Silent top
slack3r