简体   繁体   English

从Windows中的闪烁命令提示符停止vim?

[英]Stop vim from flashing command prompt in Windows?

Vim under win32 opens a command prompt ( vimrun.exe actually, which opens in a terminal window) on every external command, silent or not. 在win32下的Vim会在每个外部命令上打开一个命令提示符(实际上是vimrun.exe ,它会在终端窗口中打开),无论是否silent Yes, the terminal closes automatically, but it is still quite annoying. 是的,终端自动关闭,但它仍然很烦人。

This makes plugins that make extensive use of external commands, such as syntastic (it runs a command on buffer open/save), a real pain. 这使得广泛使用外部命令的插件,例如syntastic (它在缓冲区打开/保存时运行命令),真正的痛苦。

Is there some way to fix this behavior? 有没有办法解决这个问题? What I want is for the terminal to open only for non- silent commands. 我想要的是终端只能打开非silent命令。

Rather than just ![windows command] you might try: 而不仅仅是![windows command]你可能会尝试:

!start /min [windows command]

Alternatively, if you define a shortcut to a windows app you can click on the shortcut's properties and set it up to run as 'Minimized' rather than as 'Normal' 或者,如果您定义了一个Windows应用程序的快捷方式,您可以单击快捷方式的属性并将其设置为“最小化”而不是“正常”

In both cases above an app button will show up on taskbar as the app is opened, as there would be for any minimized application. 在上述两种情况下,当应用程序打开时,app按钮将显示在任务栏上,因为任何最小化的应用程序都会出现。 But it's less intrusive than having an actual window open. 但它比打开一个实际的窗口更少侵入。

NOTE The !start command solution runs the command asynchronously, resumes Vim immediately without waiting for the command to complete, which may often not be what you want. 注意 !start命令解决方案异步运行命令,立即恢复Vim,无需等待命令完成,这通常不是您想要的。 In that case the use of shortcut set up to run as minimized is better solution. 在这种情况下,使用快捷方式设置以最小化运行是更好的解决方案。

Just to bring closure: I wrote a replacement runner utility for Vim on Windows that doesn't open a visible command prompt. 只是为了关闭:我在Windows上为Vim编写了一个替换运行器实用程序,它不会打开一个可见的命令提示符。 Here it is: vimrun-silent . 这是: vimrun-silent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM