split pane toggle
This commit is contained in:
parent
d3ec5c57c6
commit
0a2b98e59f
1 changed files with 21 additions and 0 deletions
|
@ -129,6 +129,27 @@ config.keys = {
|
||||||
action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }),
|
action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ -- If there is only one pane, split it vertically, otherwise toggle zoom on the first pane.
|
||||||
|
key = "`",
|
||||||
|
mods = "LEADER",
|
||||||
|
action = wezterm.action_callback(function(_, pane)
|
||||||
|
local tab = pane:tab()
|
||||||
|
local panes = tab:panes_with_info()
|
||||||
|
if #panes == 1 then
|
||||||
|
pane:split({
|
||||||
|
direction = "Bottom",
|
||||||
|
size = 0.3,
|
||||||
|
})
|
||||||
|
elseif not panes[1].is_zoomed then
|
||||||
|
panes[1].pane:activate()
|
||||||
|
tab:set_zoomed(true)
|
||||||
|
elseif panes[1].is_zoomed then
|
||||||
|
tab:set_zoomed(false)
|
||||||
|
panes[2].pane:activate()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
},
|
||||||
|
|
||||||
{ -- Close pane
|
{ -- Close pane
|
||||||
key = "q",
|
key = "q",
|
||||||
mods = "LEADER",
|
mods = "LEADER",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue