add toggleterm plugin
This commit is contained in:
		
							parent
							
								
									9375eae25c
								
							
						
					
					
						commit
						dcf6329c0a
					
				
							
								
								
									
										18
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										18
									
								
								init.lua
								
								
								
								
							|  | @ -41,6 +41,20 @@ P.S. You can delete this when you're done too. It's your config now :) | |||
| 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 = "", | ||||
| } | ||||
| 
 | ||||
| for option, value in pairs(powershell_options) do | ||||
|   vim.opt[option] = value | ||||
| end | ||||
| 
 | ||||
| -- Install package manager | ||||
| --    https://github.com/folke/lazy.nvim | ||||
| --    `:help lazy.nvim.txt` for more info | ||||
|  | @ -267,6 +281,10 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true }) | |||
| vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) | ||||
| vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) | ||||
| 
 | ||||
| -- Set terminal keymaps | ||||
| vim.keymap.set('t', '<esc>', [[<C-\><C-n>]]) | ||||
| vim.keymap.set('t', 'jk', [[<C-\><C-n>]]) | ||||
| 
 | ||||
| -- [[ Highlight on yank ]] | ||||
| -- See `:help vim.highlight.on_yank()` | ||||
| local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) | ||||
|  |  | |||
|  | @ -3,6 +3,7 @@ | |||
| -- | ||||
| -- See the kickstart.nvim README for more information | ||||
| return { | ||||
| 	-- Undotree | ||||
| 	{ | ||||
| 		'mbbill/undotree', | ||||
| 		keys = { | ||||
|  | @ -10,6 +11,7 @@ return { | |||
| 		}, | ||||
| 	}, | ||||
| 
 | ||||
| 	-- Auto pair {, [, (, etc. | ||||
| 	{ | ||||
| 		"windwp/nvim-autopairs", | ||||
| 		config = function() | ||||
|  | @ -41,6 +43,7 @@ return { | |||
| 		end, | ||||
| 	}, | ||||
| 
 | ||||
| 	-- Url viewer | ||||
| 	{ | ||||
| 		"axieax/urlview.nvim", | ||||
| 		config = function() | ||||
|  | @ -74,4 +77,25 @@ return { | |||
| 			{ "<leader>ul", "<Cmd>UrlView<CR>", desc = "View buffer URLs" }, | ||||
| 		}, | ||||
| 	}, | ||||
| 
 | ||||
| 	-- Toggleterm: multiple terminals | ||||
| 	{ 'akinsho/toggleterm.nvim', | ||||
| 		version = "*", | ||||
| 		config = function() | ||||
| 			require("toggleterm").setup { | ||||
| 				insert_mappings = true, -- whether or not the open mapping applies in insert mode | ||||
| 				size = 10, | ||||
| 				open_mapping = [[<F7>]], | ||||
| 				shading_factor = 2, | ||||
| 				direction = "float", | ||||
| 				float_opts = { | ||||
| 					border = "curved", | ||||
| 					highlights = { | ||||
| 						border = "Normal", | ||||
| 						background = "Normal", | ||||
| 					}, | ||||
| 				}, | ||||
| 			} | ||||
| 		end, | ||||
| 	}, | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue