From fe562fb972b22aab7d5cc95b03d6c32ec477c8ca Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Thu, 8 Sep 2022 19:22:53 -0500 Subject: [PATCH] feat(nvim): add toggleterm --- .../primary/config/lua/core/mappings.lua | 3 +++ .../primary/config/lua/plugins/mappings.lua | 3 +++ .../primary/config/lua/plugins/plugins.lua | 24 +++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/dots/.nvim-environments/primary/config/lua/core/mappings.lua b/dots/.nvim-environments/primary/config/lua/core/mappings.lua index d583811a..088112da 100755 --- a/dots/.nvim-environments/primary/config/lua/core/mappings.lua +++ b/dots/.nvim-environments/primary/config/lua/core/mappings.lua @@ -50,6 +50,9 @@ M.setup = function() -- Sudo Write vim.keymap.set("c", "w!!", "w !sudo tee > /dev/null %") + + -- Terminal mappings + vim.keymap.set("t", [[]], [[]]) end return M diff --git a/dots/.nvim-environments/primary/config/lua/plugins/mappings.lua b/dots/.nvim-environments/primary/config/lua/plugins/mappings.lua index ae9cbfea..291cd72f 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/mappings.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/mappings.lua @@ -155,3 +155,6 @@ vim.keymap.set("", ";s", "HopPattern") vim.keymap.set("", ";;", "HopWord") vim.keymap.set("", ";a", "HopAnywhere") vim.keymap.set("", ";v", "HopVertical") + +-- Term/Open bindings +vim.keymap.set("n", "ot", "ToggleTerm") diff --git a/dots/.nvim-environments/primary/config/lua/plugins/plugins.lua b/dots/.nvim-environments/primary/config/lua/plugins/plugins.lua index 9b8d783c..e01c5bda 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/plugins.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/plugins.lua @@ -764,6 +764,30 @@ return packer.startup({ end, }) + use({ + "akinsho/toggleterm.nvim", + config = function() + require("toggleterm").setup({ + start_in_insert = false, + direction = "vertical", + autochdir = true, + size = function(term) + if term.direction == "vertical" then + return vim.o.columns * 0.5 + else + return 30 + end + end, + winbar = { + enable = true, + name_formatter = function(term) -- term: Terminal + return term.name + end, + }, + }) + end, + }) + -- Leave at end!!! -- Install and deploy packer plugins -- automatically