add terminal config for linux and windows
This commit is contained in:
		
							parent
							
								
									11d0840dba
								
							
						
					
					
						commit
						528706506e
					
				
							
								
								
									
										16
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										16
									
								
								init.lua
								
								
								
								
							| 
						 | 
					@ -42,7 +42,9 @@ vim.g.mapleader = ' '
 | 
				
			||||||
vim.g.maplocalleader = ' '
 | 
					vim.g.maplocalleader = ' '
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Set powershell as the terminal
 | 
					-- Set powershell as the terminal
 | 
				
			||||||
local powershell_options = {
 | 
					local powershell_options = {}
 | 
				
			||||||
 | 
					if not vim.loop.os_uname() == "linux" then
 | 
				
			||||||
 | 
					  powershell_options = {
 | 
				
			||||||
    shell = vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell",
 | 
					    shell = vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell",
 | 
				
			||||||
    shellcmdflag =
 | 
					    shellcmdflag =
 | 
				
			||||||
    "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;",
 | 
					    "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;",
 | 
				
			||||||
| 
						 | 
					@ -50,12 +52,14 @@ local powershell_options = {
 | 
				
			||||||
    shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode",
 | 
					    shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode",
 | 
				
			||||||
    shellquote = "",
 | 
					    shellquote = "",
 | 
				
			||||||
    shellxquote = "",
 | 
					    shellxquote = "",
 | 
				
			||||||
}
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for option, value in pairs(powershell_options) do
 | 
					  for option, value in pairs(powershell_options) do
 | 
				
			||||||
    vim.opt[option] = value
 | 
					    vim.opt[option] = value
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Install package manager
 | 
					-- Install package manager
 | 
				
			||||||
--    https://github.com/folke/lazy.nvim
 | 
					--    https://github.com/folke/lazy.nvim
 | 
				
			||||||
--    `:help lazy.nvim.txt` for more info
 | 
					--    `:help lazy.nvim.txt` for more info
 | 
				
			||||||
| 
						 | 
					@ -387,7 +391,7 @@ cmp.setup {
 | 
				
			||||||
    end,
 | 
					    end,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  mapping = cmp.mapping.preset.insert {
 | 
					  mapping = cmp.mapping.preset.insert {
 | 
				
			||||||
        ['<C-d>'] = cmp.mapping.scroll_docs(-4),
 | 
					    ['<C-d>'] = cmp.mapping.scroll_docs( -4),
 | 
				
			||||||
    ['<C-f>'] = cmp.mapping.scroll_docs(4),
 | 
					    ['<C-f>'] = cmp.mapping.scroll_docs(4),
 | 
				
			||||||
    ['<C-Space>'] = cmp.mapping.complete {},
 | 
					    ['<C-Space>'] = cmp.mapping.complete {},
 | 
				
			||||||
    ['<CR>'] = cmp.mapping.confirm {
 | 
					    ['<CR>'] = cmp.mapping.confirm {
 | 
				
			||||||
| 
						 | 
					@ -411,8 +415,8 @@ cmp.setup {
 | 
				
			||||||
    ["<S-Tab>"] = cmp.mapping(function(fallback)
 | 
					    ["<S-Tab>"] = cmp.mapping(function(fallback)
 | 
				
			||||||
      if cmp.visible() then
 | 
					      if cmp.visible() then
 | 
				
			||||||
        cmp.select_prev_item()
 | 
					        cmp.select_prev_item()
 | 
				
			||||||
      elseif luasnip.jumpable(-1) then
 | 
					      elseif luasnip.jumpable( -1) then
 | 
				
			||||||
        luasnip.jump(-1)
 | 
					        luasnip.jump( -1)
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        fallback()
 | 
					        fallback()
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue