From dcf6329c0aeddafb368ca40f1af8c4f5d5b91dde Mon Sep 17 00:00:00 2001 From: Luke Johnson Date: Tue, 28 Feb 2023 13:26:14 -0700 Subject: [PATCH] add toggleterm plugin --- init.lua | 18 ++++++++++++++++++ lua/custom/plugins/init.lua | 24 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/init.lua b/init.lua index 30f2b2c0..33f4440f 100644 --- a/init.lua +++ b/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' }, '', '', { 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', '', [[]]) +vim.keymap.set('t', 'jk', [[]]) + -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index a2d2b57e..ef246de3 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -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 { { "ul", "UrlView", 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 = [[]], + shading_factor = 2, + direction = "float", + float_opts = { + border = "curved", + highlights = { + border = "Normal", + background = "Normal", + }, + }, + } + end, + }, }