From 190306f765cf3e082e99c7ed07e168ed7bf88338 Mon Sep 17 00:00:00 2001 From: rootiest Date: Wed, 20 Nov 2024 02:26:52 -0500 Subject: [PATCH] feat: add toggle tab bar functionality --- config/keys.lua | 1 + funcs.lua | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/config/keys.lua b/config/keys.lua index cd31982..54ba15d 100644 --- a/config/keys.lua +++ b/config/keys.lua @@ -188,6 +188,7 @@ local opts = { mods = LeaderCtrl, action = tunicodes.DefaultAction, }, + { key = "u", mods = LeaderCtrl, action = act.EmitEvent("toggle-tabbar") }, }, -- ━━━━━━━━━━━━━━━━━━━━━━ Conditional Key Mappings ━━━━━━━━━━━━━━━━━━━ diff --git a/funcs.lua b/funcs.lua index 0584159..e002bfe 100644 --- a/funcs.lua +++ b/funcs.lua @@ -25,6 +25,16 @@ wezterm.on("update-status", function(window, pane) end end) +wezterm.on("toggle-tabbar", function(window, _) + local overrides = window:get_config_overrides() or {} + if overrides.enable_tab_bar == false then + overrides.enable_tab_bar = true + else + overrides.enable_tab_bar = false + end + window:set_config_overrides(overrides) +end) + ---@function Function to render the leader icon ---@return string leadericon The leader icon function M.leader_component()