如何在Windows的Git上将gVim设置为我的编辑器? [英] How can I set up gVim as my editor on Git for Windows?

查看:97
本文介绍了如何在Windows的Git上将gVim设置为我的编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用gVim作为Git提交消息的编辑器.我意识到Git有自己的vim版本,但它与我整天都在使用的gVim(以及我的_vimrc设置)不太一样.

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.

推荐答案

通过将core.editor配置为包含安装gVim的路径,可以将gVim与Git一起使用.您还需要在前台运行它,而不要加载_viminfo文件,该文件会将光标定位在完成上一条提交消息的位置.

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"

这篇关于如何在Windows的Git上将gVim设置为我的编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆