vxs8122
vxs8122

Reputation: 844

How to configure c.vim so it can compile in Powershell Vim?

I don't have this problem when compiling c files in vim on Ubuntu with c.vim plugin, but on Windows I get this error when compiling in vim (from typing \rc or \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

I have MinGW already installed and can run gcc outside of vim. Also, I used Set-ExecutionPolicy RemoteSigned and other ps1 files are working too. Is there a way I can fix this problem so that I could be able to compile inside vim?

Upvotes: 1

Views: 994

Answers (1)

Keith Hill
Keith Hill

Reputation: 201672

It sounds like your Microsoft.PowerShell_profile.ps1 file was downloaded and has the Internet_Zone flag set. Use the Unblock-File command on this file to unblock it and try again.

Also it could be that VIM is firing up a 32-bit shell. The execution to specific to each PowerShell console - x64 and x86.

Upvotes: 3

Related Questions