How to configure gVim as my editor on Git for Windows?

I would like to use gVim as my editor for Git commit messages. I understand that Git has its own version of vim, but this is not quite the same as gVim (along with my _vimrc settings), which I use all day anyway.

+7
git windows vim
source share
1 answer

You can use gVim with Git by configuring core.editor to contain the path where gVim is installed. You will also want to run it in the foreground and not load the _viminfo file, which positions your cursor in the place where you ended your previous commit message.

Given single and double quotes, you can do something like this:

 git config --global core.editor "'C:\Program Files (x86)\Vim\vim74\gvim.exe' -f -i NONE" 
+13
source share

All Articles