Q:

How to prevent `git difftool` from calling another `vimdiff`?

I have git configured (like below) to use vimdiff as difftool and compare another pair of files without prompting as soon as I call :qa. It's awesome. The only problem is sometimes there are differences in many files. How do I prevent git from running another vimdiff instance and continuing the diffs queue?
git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global alias.d difftool

I tried to quit vim with a non-zero error code (:cq) but it doesn't help.
Would be awesome if the answer worked for both vim and nvim.

A:

I found a possible solution from another question.  Try running:
git config --global difftool.trustExitCode true
git config --global mergetool.trustExitCode true

And then exiting with the non-zero :cq
Original: https://stackoverflow.com/questions/2786619/how-do-you-cancel-an-external-git-diff

