How do I supress the "2 files to edit" message in vimdiff?

'vimdiff a b' always prints "2 files to edit". I don't want to see that. How can I avoid it?

Here is an example:

⚡ vimdiff a b
2 files to edit

I want to use vimdiff from a bash script and don't want to see this output

10

3 Answers

Looking through the vim source, it looks like that message can only be suppressed when launching the executable as ex and using its -s option, or by not having a console.

Neither approach will work for diffing.

However, the message is only output if there is more than one file specified on the command line.

So let's trick it:

vim a -c "vert diffsplit b"

Which basically says "Edit file a with vim, and once a is loaded, open a vertical split with file b and diff them".

5

Set in your .vimrc

set shortmess=at

More tips and triks.

1

According to this post on SO, setting this in your vimrc should do the trick:

set shortmess=filnxtToO
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like