wezterm.lua
                        
                             · 630 B · Lua
                        
                    
                    
                      
                        Surowy
                      
                      
                        
                          
                        
                    
                    
                
                
            config.keys = {
  { -- 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),
  },
}
return config
                | 1 | config.keys = { | 
| 2 | { -- If there is only one pane, split it vertically, otherwise toggle zoom on the first pane. | 
| 3 | key = "`", | 
| 4 | mods = "LEADER", | 
| 5 | action = wezterm.action_callback(function(_, pane) | 
| 6 | local tab = pane:tab() | 
| 7 | local panes = tab:panes_with_info() | 
| 8 | if #panes == 1 then | 
| 9 | pane:split({ | 
| 10 | direction = "Bottom", | 
| 11 | size = 0.3, | 
| 12 | }) | 
| 13 | elseif not panes[1].is_zoomed then | 
| 14 | panes[1].pane:activate() | 
| 15 | tab:set_zoomed(true) | 
| 16 | elseif panes[1].is_zoomed then | 
| 17 | tab:set_zoomed(false) | 
| 18 | panes[2].pane:activate() | 
| 19 | end | 
| 20 | end), | 
| 21 | }, | 
| 22 | } | 
| 23 | |
| 24 | return config |