When using vimdiff with git and lots of changed files, vimdiff will open each file sequentially. It opens up the next file once you have closed the current file.
But what if I just want to break out of the whole diff process and also do not want to have coming diffs open?
How can I stop all diffs when using vimdiff?
OK, I found it.
in .gitconfig:
[difftool] # Be able to abort all diffs with `:cq` or `:cquit` trustExitCode = true
Then inside vim just enter :cq
or :cquit
. This will exit vim with error codes and git has been told to rely on the error codes with trustExitCode
.
How can I stop all diffs when using vimdiff?
Probably no need to customize your .gitconfig
. Use the vim commands instead:
:qa
close all (without saving):wqa
save all then quit
For both commands you can force the action by adding the !
at the end:
:qa!
force quit all (without saving any modifications):wqa!
force quit all (force saving your modifications)
In vim check :help :qa
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With