Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using `gvim diff` instead of `vimdiff`

Tags:

git

vim

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?

like image 291
user122072 Avatar asked Mar 20 '26 09:03

user122072


1 Answers

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.

like image 119
Peter Rincker Avatar answered Mar 22 '26 02:03

Peter Rincker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!