Last active
August 28, 2023 21:06
-
-
Save madushan1000/8d912e9aaaaf76bacdc399a4ac833db4 to your computer and use it in GitHub Desktop.
wezterm tmux keybindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local config = {} | |
config.key_tables = { | |
tmux_bindings = { | |
{ key = "a", mods = "CTRL", action=wezterm.action{SendString="\x01"}}, | |
{ key = "\"", mods = "SHIFT", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}}, | |
{ key = "%",mods = "SHIFT", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}}, | |
{ | |
key = "z", | |
action=wezterm.action.Multiple { | |
"TogglePaneZoomState", | |
"PopKeyTable", | |
}, | |
}, | |
{ key = "x", action=wezterm.action.CloseCurrentPane { confirm = true }, }, | |
{ key = "q", action=wezterm.action{PaneSelect={alphabet = '0123456789'}}}, | |
{ key = 'o', mods = 'CTRL', action = wezterm.action.RotatePanes 'Clockwise' }, | |
{ key = "o", action=wezterm.action{ActivatePaneDirection="Next"}}, | |
{ key = "n", action=wezterm.action{ActivatePaneDirection="Next"}}, | |
{ key = "p", action=wezterm.action{ActivatePaneDirection="Prev"}}, | |
{ key = "RightArrow", action=wezterm.action{ActivatePaneDirection="Right"}}, | |
{ key = "LeftArrow", action=wezterm.action{ActivatePaneDirection="Left"}}, | |
{ key = "UpArrow", action=wezterm.action{ActivatePaneDirection="Up"}}, | |
{ key = "DownArrow", action=wezterm.action{ActivatePaneDirection="Down"}}, | |
{ key = "RightArrow", mods = "CTRL", action=wezterm.action{AdjustPaneSize={"Right", 2}}}, | |
{ key = "LeftArrow", mods = "CTRL", action=wezterm.action{AdjustPaneSize={"Left", 2}}}, | |
{ key = "UpArrow", mods = "CTRL", action=wezterm.action{AdjustPaneSize={"Up", 2}}}, | |
{ key = "DownArrow", mods = "CTRL", action=wezterm.action{AdjustPaneSize={"Down", 2}}}, | |
{ key = "!", mods = "SHIFT", action=wezterm.action_callback(function(win, pane) local tab, window = pane:move_to_new_window() end)}, | |
{ key = "k", action=wezterm.action.ClearScrollback 'ScrollbackAndViewport'}, | |
{ key = "l", action=wezterm.action.ClearScrollback 'ScrollbackOnly' }, | |
} | |
} | |
config.keys = { | |
{ | |
key = "a", | |
mods = 'CTRL', | |
action = wezterm.action.ActivateKeyTable { | |
name = 'tmux_bindings', | |
timeout_milliseconds = 500, | |
one_shot = false, | |
}, | |
} | |
} | |
return config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is also a hacky way to merge panes back into a window, there is a command
wezterm cli split-pane --move-pane-id
we can use to merge any pane into split of current pane. As far as I can see, this functionality is not exposed via lua.