rm nvterm & use ui.term related mappings

This commit is contained in:
siduck 2023-09-25 12:28:05 +05:30
parent e868fab1f2
commit 92b7f38e83
2 changed files with 58 additions and 63 deletions

View File

@ -292,70 +292,76 @@ M.telescope = {
},
}
M.nvterm = {
plugin = true,
t = {
-- toggle in terminal mode
["<A-i>"] = {
function()
require("nvterm.terminal").toggle "float"
end,
"Toggle floating term",
},
["<A-h>"] = {
function()
require("nvterm.terminal").toggle "horizontal"
end,
"Toggle horizontal term",
},
["<A-v>"] = {
function()
require("nvterm.terminal").toggle "vertical"
end,
"Toggle vertical term",
},
},
M.terminal = {
n = {
-- toggle in normal mode
["<A-i>"] = {
function()
require("nvterm.terminal").toggle "float"
end,
"Toggle floating term",
},
["<A-h>"] = {
function()
require("nvterm.terminal").toggle "horizontal"
end,
"Toggle horizontal term",
},
["<A-v>"] = {
function()
require("nvterm.terminal").toggle "vertical"
end,
"Toggle vertical term",
},
-- new
-- spawn new terms
["<leader>h"] = {
function()
require("nvterm.terminal").new "horizontal"
require("nvchad.term").new { pos = "sp", size = 0.3 }
end,
"New horizontal term",
},
["<leader>v"] = {
function()
require("nvterm.terminal").new "vertical"
require("nvchad.term").new { pos = "vsp", size = 0.3 }
end,
"New vertical term",
},
-- toggle terms
["<A-v>"] = {
function()
require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm", size = 0.3 }
end,
"New vertical term",
},
["<A-h>"] = {
function()
require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm", size = 0.2 }
end,
"New vertical term",
},
["<A-i>"] = {
function()
require("nvchad.term").toggle { pos = "float", id = "floatTerm" }
end,
"Toggleable Floating term",
},
},
-- toggle terms in terminal mode
t = {
["<ESC>"] = {
function()
local win = vim.api.nvim_get_current_win()
vim.api.nvim_win_close(win, true)
end,
"close term in terminal mode",
},
["<A-v>"] = {
function()
require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm" }
end,
"New vertical term",
},
["<A-h>"] = {
function()
require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" }
end,
"New vertical term",
},
["<A-i>"] = {
function()
require("nvchad.term").toggle { pos = "float", id = "floatTerm" }
end,
"Toggleable Floating term",
},
},
}

View File

@ -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()