diff --git a/init.lua b/init.lua index 9c3d375d..046a67c0 100644 --- a/init.lua +++ b/init.lua @@ -42,20 +42,24 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set powershell as the terminal -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 = "", -} +local powershell_options = {} +if not vim.loop.os_uname() == "linux" then + 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 = "", + } -for option, value in pairs(powershell_options) do - vim.opt[option] = value + for option, value in pairs(powershell_options) do + vim.opt[option] = value + end end + -- Install package manager -- https://github.com/folke/lazy.nvim -- `:help lazy.nvim.txt` for more info @@ -264,8 +268,8 @@ require('telescope').setup { defaults = { mappings = { i = { - [''] = false, - [''] = false, + [''] = false, + [''] = false, }, }, }, @@ -387,14 +391,14 @@ cmp.setup { end, }, mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { + [''] = cmp.mapping.scroll_docs( -4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete {}, + [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, }, - [""] = cmp.mapping(function(fallback) + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() @@ -408,11 +412,11 @@ cmp.setup { end end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) + elseif luasnip.jumpable( -1) then + luasnip.jump( -1) else fallback() end