How do I use installed Vim in Git Bash instead of the one that came with Git?

By default Git runs vim from Git\bin\vim. This is actually a script that contains path to the executable itself:

#!/bin/sh
exec /share/vim/vim73/vim "$@"

Therefore you can edit this file to point to your Git location.

The default editor can be overridden in Git\etc\gitconfig:

[core]
editor = path_to_your_editor

Assuming that changing content of C:\Program Files (x86)\{vim,git} is possible you have at least these two options depending on value of your %PATH% environment variable:

  1. If you have C:\Program Files (x86)\vim\vim73 in your %PATH% you can just remove vim binary that was installed with Git. For this to work Vim should be run as vim and not by a full path.

  2. You probably have your Program Files (x86) directory on a NTFS volume, so you can remove Vim executable installed by Git and make a symbolic link to real Vim executable.


If your installation of Vim is available on path, open up Powershell console and execute this:

git config --global core.editor "$(Get-Command vim | % { $_.Source -replace '\\','\\\\' })"

It will set your git editor to Vim that is on path.