vim not loading _vimrc file when launched from git bash

msysgit comes with its own version of vim.

You can verify this by running

type vim

inside your git bash prompt.

I think it will tell you that vim = /bin/vim, not /c/Program Files/Vim/Vim.exe.

Then run

vim --version | grep vimrc

to see which config files it looks for.

On my system, it says

$ vim --version | grep vimrc
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$VIM\_vimrc"

$VIM points to C:\Program Files\Git\share\vim and $HOME points to c:\Users\USERNAME.

I guess your best option is to run your Windows-based version of vim, e.g.

alias vim='/c/Program Files/Vim/Vim.exe'

or similar.

Or you could move the msysgit version of vim aside, e.g.

mv /bin/vim /bin/vim.disabled

/bin/vim is just a redirect script, you can modify it and set the path to whatever you want.

Edit C:\Program Files (x86)\Git\bin\vim as an administrator.

Change this:

#!/bin/sh

exec /share/vim/vim74/vim "$@"

To this (or whatever your path is):

#!/bin/sh

exec "/c/Program Files (x86)/Vim/vim74/gvim.exe" "$@"