Skip to content

Commit

Permalink
improve powershell setup on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jmkelly committed Jan 3, 2024
1 parent e0589b2 commit 1783a71
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion lua/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,24 @@ vim.o.shiftwidth = 4
-- Use tabs instead of spaces
vim.o.expandtab = false


local powershell_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 = "",
}


--only apply the powershell settings for windows
if vim.loop.os_uname().sysname == "Windows_NT" then
vim.o.shell="pwsh"
for option, value in pairs(powershell_options) do
vim.opt[option] = value
end
end




0 comments on commit 1783a71

Please sign in to comment.