如何配置c.vim以便它可以在Powershell Vim中编译?

时间:2014-06-14 19:18:05

标签: c powershell vim plugins

在使用c.vim插件在Ubuntu上用vim编译c文件时我没有这个问题,但在Windows上我在vim中编译时遇到此错误(来自输入\ rc或\ rr):

File C:\Users\Kosine\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:2
+ . <<<< 'C:\Users\Kosine\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'
    + CategoryInfo         : NotSpecified: (:) [], PSSecurityException

The term 'gcc.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char: 8
+ gcc.exe <<<<   -Wall -g -00 -c C:/Users/Kosine/Programming/prog0402.c -o C:/User/Kosine/Programming/prog0402.obj > C:/User/Kosine/AppData/Local/Temp/VIeCE08.tmp
    + CategoryInfo          : ObjectNotFound: (gcc.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorID : CommandNotFoundException

我已经安装了MinGW,可以在vim之外运行gcc。此外,我使用Set-ExecutionPolicy RemoteSigned和其他ps1文件也正常工作。有没有办法可以解决这个问题,这样我才能在vim里面编译?

1 个答案:

答案 0 :(得分:3)

听起来您的Microsoft.PowerShell_profile.ps1文件已下载并设置了Internet_Zone标志。使用此文件上的Unblock-File命令取消阻止,然后重试。

也可能是VIM正在发射一个32位的shell。特定于每个PowerShell控制台的执行 - x64和x86。