How to Use VimR as git difftool / mergetool

By installing the bundled command line tool vimr, you can use VimR as your git difftool and/or git mergetool.

VimR as git difftool

To do so, install the command line tool into your $PATH by using the “Copy ‘vimr’ CLI Tool…” button in the General preferences and add the following to ~/.gitconfig

tool = vimrdiff
[difftool "vimrdiff"]
cmd = vimr --nvim --wait -d $LOCAL $REMOTE
tool = vimrdiff
[mergetool "vimrdiff"]
cmd = vimr --nvim --wait -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'

Now, if you use git difftool or git mergetool, VimR will open. If you want to return to Terminal after closing the VimR window, you can set “After Last Window Closes” to “Hide” in the General preferences. Oh, and ctrl-w = could be useful to make the vertical splits equally wide.