EDIT: user Christian Brabandt points out that
v:progpath will still only contain
/usr/bin/vim when invoked through git-for-windows, so this solution will not work.
Maybe something along these lines?
if v:progpath =~ "git"
v:progpath should contain a path to the running vim executable, and (assuming that the version of vim that
git commit spawns is included in your git installation)
=~ "git" should detect whether that executable is within git's installation directory. (This is all very hypothetical of course)
v:progpath Contains the command with which Vim was invoked, in a form
that when passed to the shell will run the same Vim executable
as the current one (if $PATH remains unchanged).
Useful if you want to message a Vim server using a
To get the full path use:
If the command has a relative path it will be expanded to the
full path, so that it still works after `:cd`. Thus starting
"./vim" results in "/home/user/path/to/vim/src/vim".
On Linux and other systems it will always be the full path.
On Mac it may just be "vim" and using exepath() as mentioned
above should be used to get the full path.
On MS-Windows the executable may be called "vim.exe", but the
".exe" is not added to v:progpath.