vim not working when calling git commit within cygwin vim not working when calling git commit within cygwin git git

vim not working when calling git commit within cygwin


This might be cause by mintty, see this issue.

There are two ways to fix:

  1. Use bash.exe instead of mintty:

    Right click on the shortcut of cygwin, change it from C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico - to C:\cygwin64\bin\bash.exe --login -i

  2. Add the correct vim path to git config:

    git config --global core.editor "C:/cygwin64/bin/vim.exe"

    Note that don't use cygdrive in the path as .gitconfig can't recognize it. And if you are using 32-bit vim, then the path should be C:/cygwin/bin/


You may have Git for Windows (msysgit) or Vim for Windows installed. Out of the box they are not compatible with Cygwin64 - you would need to configure your pathing for Cygwin to ignore those installations.

The easier option would be to uninstall both of those items and just use the Cygwin version.

If you need to keep them for whatever reason, set your $PATH variable in your .bash_profile as an override. Use your existing $PATH, minus the msysgit and windows vim paths. If you're into bash scripting, you could try the following to remove the paths when using bash, modified to your particular situation:

msysgit='/cygdrive/c/Program Files/git:'PATH="${msysgit//$PATH/}"msysvim='/cygdrive/c/Program Files (x86)/vim/vim74:'PATH="${mysysvim//$PATH/}"

Good luck!


You have the windows version of GIT installed rather than the CYGWIN version of GIT installed. GIT by default comes with a full set of UNIX tools including its own version of VI. Unfortunately, that version of VI does not play nice with CYGWIN. The best way around this is to install GIT in CYGWIN so that it will use the CYGWIN version of VI or VIM.