local function toggle_floating_tui(cmd) local terminal return function() if not terminal then local Terminal = require("toggleterm.terminal").Terminal terminal = Terminal:new { cmd = cmd, hidden = true, close_on_exit = true, direction = "float", on_open = function() vim.cmd "startinsert!" end, } end terminal:toggle() end end local toggle_k9s = toggle_floating_tui "k9s" local toggle_ghdash = toggle_floating_tui "gh-dash" return { { "AstroNvim/astrocore", ---@type AstroCoreOpts opts = { mappings = { n = { ["k"] = { desc = "Kubernetes" }, ["ki"] = { toggle_k9s, desc = "K9s", }, ["gD"] = { toggle_ghdash, desc = "GitHub dashboard", }, }, }, }, }, }