local Terminal = require("toggleterm.terminal").Terminal local M = {} M.lazygit = Terminal:new({ cmd = "lazygit", hidden = true, direction = "float", float_opts = { border = "double", }, -- function to run on opening the terminal on_open = function(term) vim.cmd("startinsert!") vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", { noremap = true, silent = true }) end, -- function to run on closing the terminal on_close = function(_) vim.cmd("startinsert!") end, }) M.htop = Terminal:new({ cmd = "htop", hidden = true, direction = "float", }) return M