feat: added k9s, gh-dash to nvim config
This commit is contained in:
43
defaults/nvim/lua/plugins/mappings.lua
Normal file
43
defaults/nvim/lua/plugins/mappings.lua
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
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 = {
|
||||||
|
["<Leader>k"] = { desc = "Kubernetes" },
|
||||||
|
["<Leader>ki"] = {
|
||||||
|
toggle_k9s,
|
||||||
|
desc = "K9s",
|
||||||
|
},
|
||||||
|
["<Leader>gD"] = {
|
||||||
|
toggle_ghdash,
|
||||||
|
desc = "GitHub dashboard",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user