1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

nvimでpowershell

Last updated at Posted at 2021-08-19

#解決したかった現象
 windows11 nvim v0.5.0
 init.vimにset shell=pwshを追加したところ
 nvim及びnvim-qtで!がエラーで表示してくれない!

windowsでnvim上でpowershellを使う方法

 help powershellででてくる(0.5.0のhelp)

let &shell = has('win32') ? 'powershell' : 'pwsh'
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
set shellquote= shellxquote=

をinit.vimに追加しましょう。

いろいろやったこと

 上は知っていたが
set shell=pwsh
とか、上と同じようなコマンドを入れていたら動かなかった
 なんでまた、&shellなんでしょうねえ?setじゃだめなのか?

#ちなみに
上の設定だと、私はpowershellが動いてしまうので
let &shell = 'pwsh -NoLogo'
で動かしております。

#快適快適
 !も動くし、:termもgvimと違って色が表示されるし完璧
 これで、gvimを使い続けようと思ったが、これでnvmiでいいかなあ

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?