git Windows 机器上 github 的 mingw32 shell 的 vimrc 或 vim 配置文件在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15651286/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is vimrc or vim profile for github's mingw32 shell on a Windows machine?
提问by laserface
Cygwin has a home directory where I can store a .vimrc file to set up syntax highlighting. I know on linux machines this file is usually in a home directory and that it can be stored globally (although I haven't figure out how the global thing works yet).
Cygwin 有一个主目录,我可以在其中存储 .vimrc 文件以设置语法高亮。我知道在 linux 机器上这个文件通常在一个主目录中并且它可以全局存储(尽管我还没有弄清楚全局事物是如何工作的)。
I'm windows user (I apologize), so I use different shells for different things, and am not all too sure why syntax highlighting is not working when I launch it from the git bash shell. It works fine for cygwin and for putty. but not so much for git's mingw32.
我是 Windows 用户(我很抱歉),所以我对不同的东西使用不同的 shell,并且不太确定为什么当我从 git bash shell 启动它时语法突出显示不起作用。它适用于 cygwin 和腻子。但对于 git 的 mingw32 来说并没有那么多。
Another thing is that when I ssh to a remote server using cygwin, I cannot use Vim, but I can use Vim just fine when I connect using Putty's shell.
另一件事是,当我使用 cygwin ssh 到远程服务器时,我无法使用 Vim,但是当我使用 Putty 的 shell 连接时,我可以很好地使用 Vim。
Any help on this topic would be greatly appreciated.
对此主题的任何帮助将不胜感激。
回答by Srikanth Venugopalan
Git bash uses MSYSGIT, which comes with its own Vim . One way to look it up -
Git bash 使用 MSYSGIT,它带有自己的 Vim 。一种查找方法 -
In your git bash type
在你的 git bash 类型中
$ type vim
it will tell you which vim executable is used. In my machine it points to
它会告诉你使用的是哪个 vim 可执行文件。在我的机器中它指向
/bin/vim
/bin/vim
if you type
如果你输入
vim --version
, it spits out a lot of environment.
vim --version
,吐出很多环境。
pipe it to a grep, like this
管它到一个grep,像这样
vim --version | grep vimrc
and this will tell you the location(s) where this instance of vim will look for vimrc.
vim --version | grep vimrc
这将告诉您此 vim 实例将查找 vimrc 的位置。