How can I set up gVim as my editor on Git for Windows?

痞子三分冷 提交于 2020-08-21 06:45:52

问题


I'd like to use gVim as my editor for Git commit messages. I realize Git has its own version of vim, but it's not quite the same as gVim (along with my _vimrc settings) which I use all day anyhow.


回答1:


You can use gVim with Git by configuring your core.editor to contain the path where you have gVim installed. You'll also want to run it in the foreground and not load your _viminfo file, which would position your cursor in the place where you finished your previous commit message.

Taking note of the single and double quotes, you might do something like this:

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


来源:https://stackoverflow.com/questions/28952102/how-can-i-set-up-gvim-as-my-editor-on-git-for-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!