4

I tried looking online and it seems that no one has a simple answer to it.

In my bash script, I use vimdiff for two files, but after I close the vimdiff it shows "2 files to edit" whenever the files differ. It seems like no one has the solution to this I was wondering if there was a short way in my bash script to suppress that message not through .vimrc edits.

user3281743
  • 295
  • 1
  • 11

1 Answers1

3

Looking at Vim 7.4.265's startup code, there is no way to suppress the %d files to edit message being emitted to the terminal (and hence being visible after exit) when invoked as vimdiff.

I guess you could always submit a patch to suppress this message with a switch.


Update

I knew there would be a way to get the result you desired (without writing C)!

Invoke Vim as vim with one file argument. And then call :diffsplit on the second file. But from the command-line, via -c:

vim /path/to/first_file -c'diffsplit /path/to/second_file'
johnsyweb
  • 136,902
  • 23
  • 188
  • 247
  • The biggest problem I had using the -c flag is that I couldn't get it to properly handle a path with a space for the second file. I tried escaping it in every way that I could think of, and couldn't get it to work. I've added a different solution which gets around this problem by using the -d flag and sending output to /dev/null. – DevDaddyNick Apr 20 '17 at 16:42