I'm trying to automatically delete useless headers when calling vim
from mutt
. I've tried running vim
with the following command.
vim +'0,/^$/g/^\(Cc\|Bcc\|Reply-To\): $/d' /tmp/test
However, I get the following feedback when it starts.
"/tmp/test" 11L, 60C
3 fewer lines
Press ENTER or type command to continue
For testing purposes, if I remove the range and g (i.e. 0,/^$/g
), the command is as follows, and I do not get the additional prompt.
vim +'g/^\(Cc\|Bcc\|Reply-To\): $/d' /tmp/test
Why do I get the prompt for the first command? How can I suppress it?
Edit
I seem to only get the prompt when the command deletes three lines, e.g. when /tmp/test
consists of the following.
To: Foo
Cc:
Bcc:
Reply-To:
foo
bar
However, when there are only two lines deleted, I get no prompt, e.g. when /tmp/test
consists of the following.
To: Foo
Cc: Bar
Bcc:
Reply-To:
foo
bar
'cmdheight'
option before running theglobal
command.set cmdheight=2
before the command, thenset cmdheight=1
after. I'd upvote if it were an answer.silent
answer is actually better/shorter.silent
(obviously) gives no indication if a command has failed.