import shell options from kickstart-based config for windows-pwsh

This commit is contained in:
Baipyrus 2024-11-02 14:21:13 +01:00
parent 17f2d224b0
commit ca521b400c

View File

@ -11,9 +11,15 @@ vim.g.base_dir = vim.fn.getcwd()
-- Set display language -- Set display language
vim.cmd("silent! language en_US") vim.cmd("silent! language en_US")
-- Detect and use PowerShell on Windows -- Sets the shell to use for system() and ! commands in windows and wsl
if vim.fn.has("win32") == 1 or vim.fn.has("wsl") == 1 then if vim.fn.has("win32") == 1 or vim.fn.has("wsl") == 1 then
LazyVim.terminal.setup("pwsh") vim.opt.shell = vim.fn.executable("pwsh.exe") == 1 and "pwsh.exe" or "powershell.exe"
vim.opt.shellcmdflag =
"-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
vim.opt.shellredir = "-RedirectStandardOutput %s -NoNewWindow -Wait"
vim.opt.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
vim.opt.shellxquote = ""
vim.opt.shellquote = ""
end end
-- Indenting -- Indenting