From 295281878a8bf9590c1f82cbdccb0229fea1c3b4 Mon Sep 17 00:00:00 2001 From: rootiest Date: Wed, 19 Mar 2025 21:05:13 -0400 Subject: [PATCH] feat(keymaps): add some new keymaps to round out functionality --- config/keys.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/config/keys.lua b/config/keys.lua index 9ce7181..af8e571 100644 --- a/config/keys.lua +++ b/config/keys.lua @@ -17,6 +17,11 @@ local FuzzyLaunch = "FUZZY|TABS|DOMAINS|WORKSPACES|COMMANDS|LAUNCH_MENU_ITEMS|KE local resurrect = wezterm.plugin.require("https://github.com/MLFlexer/resurrect.wezterm") local tunicodes = require("plugins/tunicodes") +wezterm.on("get-pane-domain", function(window, pane) + local domain = pane:get_domain_name() + window:toast_notification("WezTerm", "Current Pane Domain: " .. domain, nil, 3000) +end) + local opts = { -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Leader key ━━━━━━━━━━━━━━━━━━━━━━━━━━ leader = { key = " ", mods = "CTRL", timeout_milliseconds = 1500 }, @@ -107,6 +112,11 @@ local opts = { { key = "x", mods = "LEADER", action = act.ActivateCopyMode }, -- Naming + { -- Get [D]omain Name + key = "d", + mods = "LEADER", + action = act.EmitEvent("get-pane-domain"), + }, { -- Rename [W]orkspace key = "w", mods = LeaderCtrl, @@ -218,10 +228,23 @@ local opts = { window:perform_action(wezterm.action.TogglePaneZoomState, pane) end), }, + { -- Start Split Creation Mode + key = "i", + mods = "ALT", + action = wezterm.action.ActivateKeyTable({ name = "split_mode", one_shot = true }), + }, }, -- ━━━━━━━━━━━━━━━━━━━━━━ Conditional Key Mappings ━━━━━━━━━━━━━━━━━━━ key_tables = { + split_mode = { -- Split Creation Mode + -- Split Vertical + { key = "r", action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }) }, + -- Split Horizontal + { key = "d", action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }) }, + -- Cancel key table + { key = "Escape", action = wezterm.action.PopKeyTable }, + }, resize_mode = { ---------- Resize Pane Mode ------------------------- { key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 1 }) }, { key = "h", action = act.AdjustPaneSize({ "Left", 1 }) },