fix toggleterm

This commit is contained in:
xfy
2024-09-12 17:31:27 +08:00
parent bac07587a6
commit f87c4a0b99

View File

@ -3,39 +3,39 @@ return {
"akinsho/toggleterm.nvim",
version = "*",
opts = {},
keys = function()
local test = function()
local Terminal = require("toggleterm.terminal").Terminal
local float = Terminal:new({
direction = "float",
float_opts = {
border = "curved",
},
})
float:toggle()
end
return {
{
[[<A-i>]],
test,
desc = "Toggle float terminal",
mode = { "n", "t" },
-- { noremap = true, silent = true },
config = function()
local Terminal = require("toggleterm.terminal").Terminal
local float = Terminal:new({
direction = "float",
float_opts = {
border = "curved",
},
}
})
vim.keymap.set({ "n", "t" }, "<A-i>", function()
float:toggle()
end, { noremap = true, silent = true })
end,
-- config = function()
-- local Terminal = require("toggleterm.terminal").Terminal
-- local float = Terminal:new({
-- direction = "float",
-- float_opts = {
-- border = "curved",
-- },
-- })
-- vim.keymap.set({ "n", "t" }, "<A-i>", function()
keys = { "<A-i>" },
-- keys = function()
-- local test = function()
-- local Terminal = require("toggleterm.terminal").Terminal
-- local float = Terminal:new({
-- direction = "float",
-- float_opts = {
-- border = "curved",
-- },
-- })
-- float:toggle()
-- end, { noremap = true, silent = true })
-- end
-- return {
-- {
-- [[<A-i>]],
-- test,
-- desc = "Toggle float terminal",
-- mode = { "n", "t" },
-- -- { noremap = true, silent = true },
-- },
-- }
-- end,
-- keys = { "<A-i>" },
},
}