From 92b7f38e8392c43cff8844714025fa3e330227f3 Mon Sep 17 00:00:00 2001 From: siduck Date: Mon, 25 Sep 2023 12:28:05 +0530 Subject: [PATCH] rm nvterm & use ui.term related mappings --- lua/core/mappings.lua | 110 ++++++++++++++++++++++-------------------- lua/plugins/init.lua | 11 ----- 2 files changed, 58 insertions(+), 63 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index dde5bfc..ae44e7e 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -292,70 +292,76 @@ M.telescope = { }, } -M.nvterm = { - plugin = true, - - t = { - -- toggle in terminal mode - [""] = { - function() - require("nvterm.terminal").toggle "float" - end, - "Toggle floating term", - }, - - [""] = { - function() - require("nvterm.terminal").toggle "horizontal" - end, - "Toggle horizontal term", - }, - - [""] = { - function() - require("nvterm.terminal").toggle "vertical" - end, - "Toggle vertical term", - }, - }, - +M.terminal = { n = { - -- toggle in normal mode - [""] = { - function() - require("nvterm.terminal").toggle "float" - end, - "Toggle floating term", - }, - - [""] = { - function() - require("nvterm.terminal").toggle "horizontal" - end, - "Toggle horizontal term", - }, - - [""] = { - function() - require("nvterm.terminal").toggle "vertical" - end, - "Toggle vertical term", - }, - - -- new + -- spawn new terms ["h"] = { function() - require("nvterm.terminal").new "horizontal" + require("nvchad.term").new { pos = "sp", size = 0.3 } end, "New horizontal term", }, ["v"] = { function() - require("nvterm.terminal").new "vertical" + require("nvchad.term").new { pos = "vsp", size = 0.3 } end, "New vertical term", }, + + -- toggle terms + [""] = { + function() + require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm", size = 0.3 } + end, + "New vertical term", + }, + + [""] = { + function() + require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm", size = 0.2 } + end, + "New vertical term", + }, + + [""] = { + function() + require("nvchad.term").toggle { pos = "float", id = "floatTerm" } + end, + "Toggleable Floating term", + }, + }, + + -- toggle terms in terminal mode + t = { + [""] = { + function() + local win = vim.api.nvim_get_current_win() + vim.api.nvim_win_close(win, true) + end, + "close term in terminal mode", + }, + + [""] = { + function() + require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm" } + end, + "New vertical term", + }, + + [""] = { + function() + require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" } + end, + "New vertical term", + }, + + [""] = { + function() + require("nvchad.term").toggle { pos = "float", id = "floatTerm" } + end, + "Toggleable Floating term", + }, }, } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index a517851..1567a64 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -18,17 +18,6 @@ local default_plugins = { lazy = false, }, - { - "NvChad/nvterm", - init = function() - require("core.utils").load_mappings "nvterm" - end, - config = function(_, opts) - require "base46.term" - require("nvterm").setup(opts) - end, - }, - { "NvChad/nvim-colorizer.lua", init = function()