gi-6ren">
gpt4 book ai didi

git - 我无法让 Git 在 DOS SHELL 中使用 Vim——它说 "cannot run sh"

转载 作者:太空狗 更新时间:2023-10-29 14:01:52 26 4
gpt4 key购买 nike

我想让 Git 使用 Vim。我对此并不陌生,至少在 Unix 上,它真的很容易。但与 DOS 中的任何东西一样,这似乎是一场毫无意义的斗争。我想我可能遗漏了一些明显的东西。

所以我这样做了:

>git config --global core.editor "\"c:\Program Files\Vim\vim71\gvim.exe\""

但这种情况发生了:

> C:\dev\qfnet\quickfix.net>git commit -a
"c:\Program Files\Vim\vim71\gvim.exe": c:\Program Files\Vim\vim71\gvim.exe: command not found
error: cannot run sh: No such file or directory
error: There was a problem with the editor '"c:\Program Files\Vim\vim71\gvim.exe"'.
Please supply the message using either -m or -F option.

我也尝试设置 EDITOR 变量,结果相似。

“sh”在我的路径中,所以我不知道为什么找不到它。据我所知,如果我从提示中运行“sh”,它会正确启动。 (无论如何,它试图运行“sh”是为了什么?)

感谢任何可以告诉我我所缺少的东西的人。

最佳答案

试试这个:

git config --global core.editor "'C:/Program Files/Vim/vim71/gvim.exe' --nofork '%*'"

关于git - 我无法让 Git 在 DOS SHELL 中使用 Vim——它说 "cannot run sh",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7167669/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com