Vim with Powershell

后端 未结 12 478
梦毁少年i
梦毁少年i 2020-12-07 12:42

I\'m using gvim on Windows.

In my _vimrc I\'ve added:

set shell=powershell.exe
set shellcmdflag=-c
set shellpipe=>
set shellredir=>

function!          


        
12条回答
  •  我在风中等你
    2020-12-07 13:01

    None of the answers on this page were working for me until I found this hint from https://github.com/dougireton/mirror_pond/blob/master/vimrc - set shellxquote= [space character] was the missing piece.

    if has("win32") || has("gui_win32") 
         if executable("PowerShell") 
            " Set PowerShell as the shell for running external ! commands 
            " http://stackoverflow.com/questions/7605917/system-with-powershell-in-vim      
            set shell=PowerShell 
            set shellcmdflag=-ExecutionPolicy\ RemoteSigned\ -Command 
            set shellquote=\" 
            " shellxquote must be a literal space character. 
            set shellxquote=  
       endif 
    endif 
    

提交回复
热议问题