3

I use Windows, so I do not have a terminal with good color support. Because of this, I want to use gvim for my diff tool.

However, I'm not sure how to set it up so that git uses it by default, and the only way I know how to use gvimdiff is to call gvim -d.

How would I get it set up properly?

Chris Forrence
  • 10,042
  • 11
  • 48
  • 64
user122072
  • 91
  • 1
  • 8
  • I answered a similar question [here](https://stackoverflow.com/a/53541930/480454) on Windows with Git using gvimdiff. – Jim Nov 29 '18 at 15:10

1 Answers1

2

Fugitive.vim

As an alternative, have you thought about using fugitive?

I'm not going to lie to you; fugitive.vim may very well be the best Git wrapper of all time.

There is a an excellent Vimcasts episode, Fugitive.vim - resolving merge conflicts with vimdiff, by Drew Neil. This is part of a series on fugitive.

To use fugitive you can just run :Gdiff to get git diff of the current file. Bonus: you can use fugative.vim inside of GVim, MacVim, or whatever Vim gui you have.

Fugitive has a lot more to offer than just being a diff tool so make sure you read the documentation and/or check out the vimcasts.

git difftool

Use git difftool and pick gvimdiff. e.g. git difftool --tool gvimdiff instead of git diff. For more help see git difftool --help and git difftool --tool-help. You may also want to look into setting diff.guitool or diff.tool config options.

Peter Rincker
  • 43,539
  • 9
  • 74
  • 101
  • I like both options! I will give fugitive a go but I still want to set it up as asked in the question. Thanks for the suggestion though! – user122072 Apr 13 '15 at 19:28