2026-05-27 22:27:50 -04:00
|
|
|
local function toggle_tui(cmd, direction, size)
|
2026-04-10 16:36:47 -04:00
|
|
|
local terminal
|
2026-05-27 22:27:50 -04:00
|
|
|
local dir = direction or "float"
|
|
|
|
|
local term_size = size
|
2026-04-10 16:36:47 -04:00
|
|
|
|
|
|
|
|
return function()
|
|
|
|
|
if not terminal then
|
|
|
|
|
local Terminal = require("toggleterm.terminal").Terminal
|
|
|
|
|
terminal = Terminal:new {
|
|
|
|
|
cmd = cmd,
|
|
|
|
|
hidden = true,
|
|
|
|
|
close_on_exit = true,
|
2026-05-27 22:27:50 -04:00
|
|
|
direction = dir,
|
2026-04-10 16:36:47 -04:00
|
|
|
on_open = function() vim.cmd "startinsert!" end,
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2026-05-27 22:27:50 -04:00
|
|
|
terminal:toggle(term_size, dir)
|
2026-04-10 16:36:47 -04:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2026-05-27 22:27:50 -04:00
|
|
|
local toggle_k9s = toggle_tui "k9s"
|
|
|
|
|
local toggle_ghdash = toggle_tui "gh-dash"
|
|
|
|
|
local toggle_ai_opencode = toggle_tui("opencode", "vertical", 80)
|
|
|
|
|
local toggle_ai_copilot = toggle_tui("copilot", "vertical", 80)
|
2026-04-10 16:36:47 -04:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
{
|
|
|
|
|
"AstroNvim/astrocore",
|
|
|
|
|
---@type AstroCoreOpts
|
|
|
|
|
opts = {
|
|
|
|
|
mappings = {
|
|
|
|
|
n = {
|
|
|
|
|
["<Leader>k"] = { desc = "Kubernetes" },
|
|
|
|
|
["<Leader>ki"] = {
|
|
|
|
|
toggle_k9s,
|
|
|
|
|
desc = "K9s",
|
|
|
|
|
},
|
|
|
|
|
["<Leader>gD"] = {
|
|
|
|
|
toggle_ghdash,
|
|
|
|
|
desc = "GitHub dashboard",
|
|
|
|
|
},
|
2026-05-27 22:27:50 -04:00
|
|
|
["<Leader>a"] = { desc = "AI" },
|
|
|
|
|
["<Leader>ao"] = {
|
|
|
|
|
toggle_ai_opencode,
|
|
|
|
|
desc = "opencode",
|
|
|
|
|
},
|
|
|
|
|
["<Leader>ag"] = {
|
|
|
|
|
toggle_ai_copilot,
|
|
|
|
|
desc = "GH Copilot",
|
|
|
|
|
},
|
2026-04-10 16:36:47 -04:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|