diff --git a/wezterm/.config/wezterm/events.lua b/wezterm/.config/wezterm/events.lua index fd6aab8..c486f1c 100644 --- a/wezterm/.config/wezterm/events.lua +++ b/wezterm/.config/wezterm/events.lua @@ -58,6 +58,20 @@ local function setup() wezterm.sleep_ms(1000) os.remove(name) end) + + wezterm.on("toggle-leader", function(window, pane) + wezterm.log_info("toggling the leader") + local overrides = window:get_config_overrides() or {} + if not overrides.leader then + wezterm.log_info("leader wasn't set") + overrides.leader = { key = "s", mods = "SUPER" }; + else + wezterm.log_info("leader was set") + overrides.leader = nil + end + + window:set_config_overrides(overrides) + end) end return { setup = setup } diff --git a/wezterm/.config/wezterm/maps.lua b/wezterm/.config/wezterm/maps.lua index 01149b2..53a274a 100644 --- a/wezterm/.config/wezterm/maps.lua +++ b/wezterm/.config/wezterm/maps.lua @@ -73,7 +73,8 @@ local keys = { key = 'l', mods = 'LEADER', action = act.EmitEvent 'ActivatePaneDirection-Right' - } + }, + { key = 'a', mods = 'CTRL|ALT', action = act.EmitEvent 'toggle-leader'} } -- Leader + number to activate that tab @@ -108,6 +109,6 @@ local key_tables = { { key = 'g', mods = 'CTRL', action = act.ScrollToTop }, { key = 'G', mods = 'CTRL', action = act.ScrollToBottom }, { key = 'Escape', action = 'PopKeyTable' } - } + }, } return { keys = keys, key_tables = key_tables }