The following configures git to use VIM as the default editor (e.g. for commit messages) on Windows:
git config --system core.editor 'C:\\PROGRA~2\\Vim\\vim73\\gvim.exe' --wait
Explanation
- Uses short directory names. You can find these using e.g.:
dir /X "C:\Program Files (x86)*"
Notice the star at the end of the command line. This will reveal the short namePROGRA~2
- Use double backslashes
- Use single quotes
- Use the
--wait
option after closing the single quotes for the path to the VIM editor