From 4c2f4424f7c02fe5e50a71c44fa3681616421207 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 6 May 2024 09:53:28 +0200 Subject: [PATCH] set powershell as system only for windows --- lua/options.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lua/options.lua b/lua/options.lua index 7e78c87..4e469d4 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -7,13 +7,15 @@ vim.api.nvim_exec2('language en_US', {}) -- Shell options --- Sets the shell to use for system() and ! commands -vim.opt.shell = 'powershell.exe' -vim.opt.shellcmdflag = '-NonInteractive -NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command ' -vim.opt.shellxquote = '' -vim.opt.shellquote = '' -vim.opt.shellredir = '2>&1 | Out-File -Encoding UTF8 %s' -vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s' +-- Sets the shell to use for system() and ! commands in windows +if vim.fn.has 'win32' then + vim.opt.shell = 'powershell.exe' + vim.opt.shellcmdflag = '-NonInteractive -NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command ' + vim.opt.shellxquote = '' + vim.opt.shellquote = '' + vim.opt.shellredir = '2>&1 | Out-File -Encoding UTF8 %s' + vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s' +end -- Format settings -- Make line numbers default