Windows 7 上的 gvim - vimrun.exe 不运行命令 [英] gvim on windows 7 - vimrun.exe doesn't run command
问题描述
在新的 Windows 7 上构建 vim 命令实际上并没有运行,但是 gvim echo 是尝试运行的命令.
On a new windows 7 build vim commands don't actually run, but gvim echo's the command attempted to run.
在 vim 中,命令 :!dir
打开 vimrun.exe 终端并显示以下内容:
in vim the command :!dir
opens a vimrun.exe terminal and shows the following:
C:\WINDOWS\system32\cmd.exe --login -c "dir"
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\USERNAME>
窗口就这样,直到我输入 exit
并将控制权返回给 vim.
The window sits like this, until i type exit
and return control back to vim.
C:\Users\USERNAME>exit
Hit any key to close this window...
我怎样才能让 vim 在 Windows 7 上运行这样的命令?我以前在 windows xp 上没有问题.
How can i have vim run commands like this on windows 7? I had no issues on windows xp previously.
它会影响多个程序,例如 diff.exe 等.
It effects multiple programs such as diff.exe and others.
附加信息是它是最近编译的 vim 版本,内置了 python 和 ruby 支持.
Additional info is it's a recently compiled version of vim with python and ruby support built in.
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 18 2013 13:15:06)
MS-Windows 32-bit GUI version with OLE support
Compiled by J4ROCH@ACEINA
Huge version with GUI.
提前致谢,
推荐答案
传递给 cmd.exe
的 --login -c
参数是错误的.它必须是 /c
.某些东西正在改变 'shellcmdflag'
.此外,Vim 7.4 版本应该将 dir
命令包裹在括号中,而不是引号中,因此 'shellxquote'
标志也被关闭.
The --login -c
arguments passed to cmd.exe
are wrong. It has to be /c
. Something is changing the 'shellcmdflag'
. Also, that Vim 7.4 version should wrap the dir
command in parentheses, not quotes, so the 'shellxquote'
flag is off, too.
这要么是由于显式配置错误(在 ~/.vimrc
中,或由插件引起的),要么是因为 Vim 用于检测正确 shell 环境的各种启发式方法失败.检查
This is either due to an explicit misconfiguration (in ~/.vimrc
, or by a plugin), or because the various heuristics that Vim uses to detect the correct shell environment fail. Check with
:verbose set shell? shellcmdflag? shellxquote?
并阅读 :help 'shell'
以了解有关启发式方法的更多信息.
and read :help 'shell'
to learn more about the heuristics.
这篇关于Windows 7 上的 gvim - vimrun.exe 不运行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!