Vim with Powershell

后端 未结 12 479
梦毁少年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:03

    I suspect that the problem is that Powershell uses the native String encoding for .NET, which is UTF-16 plus a byte-order-mark.

    When it's piping objects between commands it's not a problem. It's a total PITA for external programs though.

    You can pipe the output through out-file, which does support changing the encoding, but still formats the output for the terminal that it's in by default (arrgh!), so things like "Get-Process" will truncate with ellipses, etc. You can specify the width of the virtual terminal that Out-File uses though.

    Not sure how useful this information is, but it does illuminate the problem a bit more.

提交回复
热议问题