0
0

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 1 year has passed since last update.

20240401 日記 NeovimのToggletermのデフォルトをpwshにする

Posted at

Neovimのtoggleterm.nvimはWindowsで使うとcmd.exeが開くのでpwshにしようと思った

Shougoさんのdeolは簡単に変更できた記憶があるので、これも簡単かなあと思ったがそんなことなかった

けど何とかできた

init.lua
if vim.loop.os_uname().sysname == 'Windows_NT' then
  local pwsh_options = {
    shell = vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell",
    shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;",
    shellredir = "-RedirectStandardOutput %s -NoNewWindow -Wait",
    shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode",
    shellquote = "",
    shellxquote = "",
  }

  for k, v in pairs(pwsh_options) do
    vim.opt[k] = v
  end
end

Windowsの時だけ実行するようにした
has('win32')みたいなのないんでしょうか
Toggletermの作者さん、過去の先達の方々、ありがとう
参考:Tips and Tricks · akinsho/toggleterm.nvim Wiki

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?