diff --git a/docs/config/lua/keyassignment/ActivateCopyMode.md b/docs/config/lua/keyassignment/ActivateCopyMode.md index 898121060..6f16be604 100644 --- a/docs/config/lua/keyassignment/ActivateCopyMode.md +++ b/docs/config/lua/keyassignment/ActivateCopyMode.md @@ -7,7 +7,7 @@ Activates copy mode! ```lua return { keys = { - {key="X", mods="CTRL", action="ActivateCopyMode"}, + {key="X", mods="CTRL", action=wezterm.action.ActivateCopyMode}, } } ``` diff --git a/docs/config/lua/keyassignment/ActivateLastTab.md b/docs/config/lua/keyassignment/ActivateLastTab.md index a1ff4ad55..99d266754 100644 --- a/docs/config/lua/keyassignment/ActivateLastTab.md +++ b/docs/config/lua/keyassignment/ActivateLastTab.md @@ -9,7 +9,7 @@ return { leader = { key="a", mods="CTRL" }, keys = { -- CTRL-a, followed by CTRL-o will switch back to the last active tab - {key="o", mods="LEADER|CTRL", action="ActivateLastTab"}, + {key="o", mods="LEADER|CTRL", action=wezterm.action.ActivateLastTab}, } } ``` diff --git a/docs/config/lua/keyassignment/ActivatePaneByIndex.md b/docs/config/lua/keyassignment/ActivatePaneByIndex.md index e9f857491..f2161978c 100644 --- a/docs/config/lua/keyassignment/ActivatePaneByIndex.md +++ b/docs/config/lua/keyassignment/ActivatePaneByIndex.md @@ -9,13 +9,14 @@ This example causes ALT-a, ALT-b, ALT-c to switch to the 0th, 1st and 2nd panes, respectively: ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action return { keys = { - {key="a", mods="ALT", action=wezterm.action{ActivatePaneByIndex=0}}, - {key="b", mods="ALT", action=wezterm.action{ActivatePaneByIndex=1}}, - {key="c", mods="ALT", action=wezterm.action{ActivatePaneByIndex=2}}, + {key="a", mods="ALT", action=act.ActivatePaneByIndex(0)}, + {key="b", mods="ALT", action=act.ActivatePaneByIndex(1)}, + {key="c", mods="ALT", action=act.ActivatePaneByIndex(2)}, } } ``` diff --git a/docs/config/lua/keyassignment/ActivatePaneDirection.md b/docs/config/lua/keyassignment/ActivatePaneDirection.md index 57e9086b6..488ab4c32 100644 --- a/docs/config/lua/keyassignment/ActivatePaneDirection.md +++ b/docs/config/lua/keyassignment/ActivatePaneDirection.md @@ -10,18 +10,19 @@ If the active pane is [zoomed](TogglePaneZoomState.md), behavior is determined by the [`unzoom_on_switch_pane`](../config/unzoom_on_switch_pane.md) flag. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action return { keys = { { key = "LeftArrow", mods="CTRL|SHIFT", - action=wezterm.action{ActivatePaneDirection="Left"}}, + action=act.ActivatePaneDirection("Left")}, { key = "RightArrow", mods="CTRL|SHIFT", - action=wezterm.action{ActivatePaneDirection="Right"}}, + action=act.ActivatePaneDirection("Right")}, { key = "UpArrow", mods="CTRL|SHIFT", - action=wezterm.action{ActivatePaneDirection="Up"}}, + action=act.ActivatePaneDirection("Up")}, { key = "DownArrow", mods="CTRL|SHIFT", - action=wezterm.action{ActivatePaneDirection="Down"}}, + action=act.ActivatePaneDirection("Down")}, } } ``` diff --git a/docs/config/lua/keyassignment/ActivateTab.md b/docs/config/lua/keyassignment/ActivateTab.md index 61c9297d0..be96331d4 100644 --- a/docs/config/lua/keyassignment/ActivateTab.md +++ b/docs/config/lua/keyassignment/ActivateTab.md @@ -11,7 +11,8 @@ to its left and so on. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action local mykeys = {} for i = 1, 8 do @@ -19,12 +20,12 @@ for i = 1, 8 do table.insert(mykeys, { key=tostring(i), mods="CTRL|ALT", - action=wezterm.action{ActivateTab=i-1}, + action=act.ActivateTab(i-1), }) -- F1 through F8 to activate that tab table.insert(mykeys, { key="F" .. tostring(i), - action=wezterm.action{ActivateTab=i-1}, + action=act.ActivateTab(i-1), }) end diff --git a/docs/config/lua/keyassignment/ActivateTabRelative.md b/docs/config/lua/keyassignment/ActivateTabRelative.md index 455cccff3..808be6063 100644 --- a/docs/config/lua/keyassignment/ActivateTabRelative.md +++ b/docs/config/lua/keyassignment/ActivateTabRelative.md @@ -5,11 +5,13 @@ offset. eg: `-1` activates the tab to the left of the current tab, while `1` activates the tab to the right. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action + return { keys = { - {key="{", mods="ALT", action=wezterm.action{ActivateTabRelative=-1}}, - {key="}", mods="ALT", action=wezterm.action{ActivateTabRelative=1}}, + {key="{", mods="ALT", action=act.ActivateTabRelative(-1)}, + {key="}", mods="ALT", action=act.ActivateTabRelative(1)}, } } ``` diff --git a/docs/config/lua/keyassignment/ActivateTabRelativeNoWrap.md b/docs/config/lua/keyassignment/ActivateTabRelativeNoWrap.md index 94f8b1ddc..398af0114 100644 --- a/docs/config/lua/keyassignment/ActivateTabRelativeNoWrap.md +++ b/docs/config/lua/keyassignment/ActivateTabRelativeNoWrap.md @@ -12,11 +12,13 @@ but this one will not wrap around; for example, if the first tab is active ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action + return { keys = { - {key="{", mods="ALT", action=wezterm.action{ActivateTabRelativeNoWrap=-1}}, - {key="}", mods="ALT", action=wezterm.action{ActivateTabRelativeNoWrap=1}}, + {key="{", mods="ALT", action=act.ActivateTabRelativeNoWrap(-1)}, + {key="}", mods="ALT", action=act.ActivateTabRelativeNoWrap(1)}, } } ``` diff --git a/docs/config/lua/keyassignment/AdjustPaneSize.md b/docs/config/lua/keyassignment/AdjustPaneSize.md index 68d92b5e9..3a23c4650 100644 --- a/docs/config/lua/keyassignment/AdjustPaneSize.md +++ b/docs/config/lua/keyassignment/AdjustPaneSize.md @@ -17,15 +17,16 @@ motion keys are used to adjust the size in their conventional directions, respectively. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action return { leader = { key="a", mods="CTRL" }, keys = { - { key = "H", mods = "LEADER", action=wezterm.action{AdjustPaneSize={"Left", 5}}}, - { key = "J", mods = "LEADER", action=wezterm.action{AdjustPaneSize={"Down", 5}}}, - { key = "K", mods = "LEADER", action=wezterm.action{AdjustPaneSize={"Up", 5}}}, - { key = "L", mods = "LEADER", action=wezterm.action{AdjustPaneSize={"Right", 5}}}, + { key = "H", mods = "LEADER", action=act.AdjustPaneSize("Left", 5)}}, + { key = "J", mods = "LEADER", action=act.AdjustPaneSize("Down", 5)}}, + { key = "K", mods = "LEADER", action=act.AdjustPaneSize("Up", 5)}}, + { key = "L", mods = "LEADER", action=act.AdjustPaneSize("Right", 5)}}, } } ``` diff --git a/docs/config/lua/keyassignment/AttachDomain.md b/docs/config/lua/keyassignment/AttachDomain.md index 7ec170121..c5fb870ec 100644 --- a/docs/config/lua/keyassignment/AttachDomain.md +++ b/docs/config/lua/keyassignment/AttachDomain.md @@ -29,7 +29,7 @@ return { } }, keys = { - {key="U", mods="CTRL|SHIFT", action=wezterm.action{AttachDomain="devhost"}}, + {key="U", mods="CTRL|SHIFT", action=wezterm.action.AttachDomain("devhost")}, }, } ``` diff --git a/docs/config/lua/keyassignment/ClearScrollback.md b/docs/config/lua/keyassignment/ClearScrollback.md index aa01dcbe8..a3b271835 100644 --- a/docs/config/lua/keyassignment/ClearScrollback.md +++ b/docs/config/lua/keyassignment/ClearScrollback.md @@ -8,13 +8,16 @@ the scrollbar thumb to the full height of the window. Added a parameter that allows additionally clear the viewport: ```lua +local wezterm = require 'wezterm' +local act = wezterm.action + return { keys = { -- Clears only the scrollback and leaves the viewport intact. -- This is the default behavior. - {key="K", mods="CTRL|SHIFT", action=wezterm.action{ClearScrollback="ScrollbackOnly"}}, + {key="K", mods="CTRL|SHIFT", action=act.ClearScrollback("ScrollbackOnly")}, -- Clears the scrollback and viewport leaving the prompt line the new first line. - {key="K", mods="CTRL|SHIFT", action=wezterm.action{ClearScrollback="ScrollbackAndViewport"}}, + {key="K", mods="CTRL|SHIFT", action=act.ClearScrollback("ScrollbackAndViewport")}, } } ``` diff --git a/docs/config/lua/keyassignment/ClearSelection.md b/docs/config/lua/keyassignment/ClearSelection.md index 4618c41ab..84c244853 100644 --- a/docs/config/lua/keyassignment/ClearSelection.md +++ b/docs/config/lua/keyassignment/ClearSelection.md @@ -10,6 +10,7 @@ CTRL-C to the terminal when there is no selection: ```lua local wezterm = require 'wezterm' +local act = wezterm.action return { keys = { @@ -20,13 +21,13 @@ return { local has_selection = window:get_selection_text_for_pane(pane) ~= "" if has_selection then window:perform_action( - wezterm.action{CopyTo="ClipboardAndPrimarySelection"}, + act.CopyTo("ClipboardAndPrimarySelection"), pane) window:perform_action("ClearSelection", pane) else window:perform_action( - wezterm.action{SendKey={key="c", mods="CTRL"}}, + act.SendKey{key="c", mods="CTRL"}}, pane) end end) diff --git a/docs/config/lua/keyassignment/CloseCurrentPane.md b/docs/config/lua/keyassignment/CloseCurrentPane.md index 7ef3ce992..28187bffe 100644 --- a/docs/config/lua/keyassignment/CloseCurrentPane.md +++ b/docs/config/lua/keyassignment/CloseCurrentPane.md @@ -8,9 +8,11 @@ The act of closing a pane shuts down the PTY associated with the pane and then kills the process associated with that pane. ```lua +local wezterm = require 'wezterm' + return { keys = { - {key="w", mods="CMD", action=wezterm.action{CloseCurrentPane={confirm=true}}}, + {key="w", mods="CMD", action=wezterm.action.CloseCurrentPane{confirm=true}}, } } ``` diff --git a/docs/config/lua/keyassignment/CloseCurrentTab.md b/docs/config/lua/keyassignment/CloseCurrentTab.md index c2dcb6568..8d5d6b2c8 100644 --- a/docs/config/lua/keyassignment/CloseCurrentTab.md +++ b/docs/config/lua/keyassignment/CloseCurrentTab.md @@ -6,20 +6,7 @@ tab, closes that window. If that was the last window, wezterm terminates. ```lua return { keys = { - {key="w", mods="CMD", action="CloseCurrentTab"}, - } -} -``` - -*Since: 20201031-154415-9614e117* - -`CloseCurrentTab` was changed so that it requires -a boolean `confirm` parameter: - -```lua -return { - keys = { - {key="w", mods="CMD", action=wezterm.action{CloseCurrentTab={confirm=true}}}, + {key="w", mods="CMD", action=wezterm.action.CloseCurrentTab{confirm=true}}, } } ``` diff --git a/docs/config/lua/keyassignment/CompleteSelection.md b/docs/config/lua/keyassignment/CompleteSelection.md index a59d6aa76..aa8da5131 100644 --- a/docs/config/lua/keyassignment/CompleteSelection.md +++ b/docs/config/lua/keyassignment/CompleteSelection.md @@ -22,7 +22,7 @@ return { { event={Up={streak=1, button="Left"}}, mods="NONE", - action=wezterm.action{CompleteSelection="Clipboard"}, + action=wezterm.action.CompleteSelection("Clipboard"), }, }, } diff --git a/docs/config/lua/keyassignment/CompleteSelectionOrOpenLinkAtMouseCursor.md b/docs/config/lua/keyassignment/CompleteSelectionOrOpenLinkAtMouseCursor.md index 5ea9a8c3c..9bbbefa8b 100644 --- a/docs/config/lua/keyassignment/CompleteSelectionOrOpenLinkAtMouseCursor.md +++ b/docs/config/lua/keyassignment/CompleteSelectionOrOpenLinkAtMouseCursor.md @@ -21,7 +21,7 @@ return { { event={Up={streak=1, button="Left"}}, mods="NONE", - action=wezterm.action{CompleteSelectionOrOpenLinkAtMouseCursor="Clipboard"}, + action=wezterm.action.CompleteSelectionOrOpenLinkAtMouseCursor("Clipboard"), }, }, } diff --git a/docs/config/lua/keyassignment/Copy.md b/docs/config/lua/keyassignment/Copy.md index e9a01503a..424db6739 100644 --- a/docs/config/lua/keyassignment/Copy.md +++ b/docs/config/lua/keyassignment/Copy.md @@ -11,10 +11,10 @@ a future release; please use [CopyTo](CopyTo.md) instead. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { keys = { - {key="C", mods="CTRL", action="Copy"}, + {key="C", mods="CTRL", action=wezterm.action.Copy}, } } ``` diff --git a/docs/config/lua/keyassignment/CopyTo.md b/docs/config/lua/keyassignment/CopyTo.md index ac112cb1b..ca45d2997 100644 --- a/docs/config/lua/keyassignment/CopyTo.md +++ b/docs/config/lua/keyassignment/CopyTo.md @@ -9,10 +9,11 @@ Possible values for destination are: * `ClipboardAndPrimarySelection` - Copy to both the clipboard and the primary selection. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' + return { keys = { - {key="C", mods="CTRL", action=wezterm.action{CopyTo="ClipboardAndPrimarySelection"}}, + {key="C", mods="CTRL", action=wezterm.action.CopyTo("ClipboardAndPrimarySelection")}, } } ``` diff --git a/docs/config/lua/keyassignment/DecreaseFontSize.md b/docs/config/lua/keyassignment/DecreaseFontSize.md index 20daa5417..3de763be8 100644 --- a/docs/config/lua/keyassignment/DecreaseFontSize.md +++ b/docs/config/lua/keyassignment/DecreaseFontSize.md @@ -3,10 +3,11 @@ Decreases the font size of the current window by 10% ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' + return { keys = { - {key="-", mods="CTRL", action="DecreaseFontSize"}, + {key="-", mods="CTRL", action=wezterm.action.DecreaseFontSize}, } } ``` diff --git a/docs/config/lua/keyassignment/DetachDomain.md b/docs/config/lua/keyassignment/DetachDomain.md index d8e42bf4e..e3a898e1a 100644 --- a/docs/config/lua/keyassignment/DetachDomain.md +++ b/docs/config/lua/keyassignment/DetachDomain.md @@ -12,6 +12,7 @@ error log/debug overlay. ```lua local wezterm = require 'wezterm' +local act = wezterm.action return { ssh_domains = { @@ -21,11 +22,11 @@ return { } }, keys = { - {key="U", mods="CTRL|SHIFT", action=wezterm.action{AttachDomain="devhost"}}, + {key="U", mods="CTRL|SHIFT", action=act.AttachDomain("devhost")}, -- Detaches the domain associated with the current pane - {key="D", mods="CTRL|SHIFT", action=wezterm.action{DetachDomain="CurrentPaneDomain"}}, + {key="D", mods="CTRL|SHIFT", action=act.DetachDomain("CurrentPaneDomain")}, -- Detaches the "devhost" domain - {key="E", mods="CTRL|SHIFT", action=wezterm.action{DetachDomain={DomainName="devhost"}}}, + {key="E", mods="CTRL|SHIFT", action=act.DetachDomain{DomainName="devhost"}}, }, } diff --git a/docs/config/lua/keyassignment/DisableDefaultAssignment.md b/docs/config/lua/keyassignment/DisableDefaultAssignment.md index 4940552cc..447b83c02 100644 --- a/docs/config/lua/keyassignment/DisableDefaultAssignment.md +++ b/docs/config/lua/keyassignment/DisableDefaultAssignment.md @@ -6,11 +6,13 @@ default assignments and cause the key press to be propagated through to the tab for processing. ```lua +local wezterm = require 'wezterm' + return { keys = { -- Turn off the default CMD-m Hide action, allowing CMD-m to -- be potentially recognized and handled by the tab - {key="m", mods="CMD", action="DisableDefaultAssignment"}, + {key="m", mods="CMD", action=wezterm.action.DisableDefaultAssignment}, } } ``` diff --git a/docs/config/lua/keyassignment/ExtendSelectionToMouseCursor.md b/docs/config/lua/keyassignment/ExtendSelectionToMouseCursor.md index 0fc28f1a7..a0c51addf 100644 --- a/docs/config/lua/keyassignment/ExtendSelectionToMouseCursor.md +++ b/docs/config/lua/keyassignment/ExtendSelectionToMouseCursor.md @@ -2,7 +2,21 @@ Extends the current text selection to the current mouse cursor position. The mode argument can be one of `Cell`, `Word` or `Line` to control -the scope of the selection. +the scope of the selection: + +```lua +local wezterm = require 'wezterm' + +return { + mouse_bindings = { + { + event={Up={streak=1, button="Left"}}, + mods="SHIFT", + action=wezterm.action.ExtendSelectionToMouseCursor("Word"), + }, + } +} +``` It is also possible to leave the mode unspecified like this: diff --git a/docs/config/lua/keyassignment/Hide.md b/docs/config/lua/keyassignment/Hide.md index 173147310..45527d6d8 100644 --- a/docs/config/lua/keyassignment/Hide.md +++ b/docs/config/lua/keyassignment/Hide.md @@ -3,9 +3,11 @@ Hides (or minimizes, depending on the platform) the current window. ```lua +local wezterm = require 'wezterm' + return { keys = { - {key="h", mods="CMD", action="Hide"}, + {key="h", mods="CMD", action=wezterm.action.Hide}, } } ``` diff --git a/docs/config/lua/keyassignment/HideApplication.md b/docs/config/lua/keyassignment/HideApplication.md index 5a6765ead..ec9609d4c 100644 --- a/docs/config/lua/keyassignment/HideApplication.md +++ b/docs/config/lua/keyassignment/HideApplication.md @@ -3,9 +3,11 @@ On macOS, hide the WezTerm application. ```lua +local wezterm = require 'wezterm' + return { keys = { - {key="h", mods="CMD", action="HideApplication"}, + {key="h", mods="CMD", action=wezterm.action.HideApplication}, } } ``` diff --git a/docs/config/lua/keyassignment/IncreaseFontSize.md b/docs/config/lua/keyassignment/IncreaseFontSize.md index 5bb529b4b..829a4ba69 100644 --- a/docs/config/lua/keyassignment/IncreaseFontSize.md +++ b/docs/config/lua/keyassignment/IncreaseFontSize.md @@ -3,10 +3,11 @@ Increases the font size of the current window by 10% ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' + return { keys = { - {key="=", mods="CTRL", action="IncreaseFontSize"}, + {key="=", mods="CTRL", action=wezterm.action.IncreaseFontSize}, } } ``` diff --git a/docs/config/lua/keyassignment/MoveTab.md b/docs/config/lua/keyassignment/MoveTab.md index 01d5dc09f..7ecb8bbfa 100644 --- a/docs/config/lua/keyassignment/MoveTab.md +++ b/docs/config/lua/keyassignment/MoveTab.md @@ -5,7 +5,8 @@ moves the tab to be leftmost, while `1` moves the tab so that it is second tab from the left, and so on. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action local mykeys = {} for i = 1, 8 do @@ -13,7 +14,7 @@ for i = 1, 8 do table.insert(mykeys, { key=tostring(i), mods="CTRL|ALT", - action=wezterm.action{MoveTab=i-1}, + action=act.MoveTab(i-1), }) end diff --git a/docs/config/lua/keyassignment/MoveTabRelative.md b/docs/config/lua/keyassignment/MoveTabRelative.md index 2d3d1b834..c8621cf81 100644 --- a/docs/config/lua/keyassignment/MoveTabRelative.md +++ b/docs/config/lua/keyassignment/MoveTabRelative.md @@ -5,11 +5,13 @@ offset. eg: `-1` moves the tab to the left of the current tab, while `1` moves the tab to the right. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.act + return { keys = { - {key="{", mods="SHIFT|ALT", action=wezterm.action{MoveTabRelative=-1}}, - {key="}", mods="SHIFT|ALT", action=wezterm.action{MoveTabRelative=1}}, + {key="{", mods="SHIFT|ALT", action=act.MoveTabRelative(-1)}, + {key="}", mods="SHIFT|ALT", action=act.MoveTabRelative(1)}, } } ``` diff --git a/docs/config/lua/keyassignment/Multiple.md b/docs/config/lua/keyassignment/Multiple.md index 271716a65..969d20d03 100644 --- a/docs/config/lua/keyassignment/Multiple.md +++ b/docs/config/lua/keyassignment/Multiple.md @@ -8,14 +8,17 @@ want a single key press to trigger multiple actions. The example below causes `LeftArrow` to effectively type `left`: ```lua +local wezterm = require 'wezterm' +local act = wezterm.action + return { keys = { - {key="LeftArrow", action={Multiple={ - {SendKey={key="l"}}, - {SendKey={key="e"}}, - {SendKey={key="f"}}, - {SendKey={key="t"}}, - }}} + {key="LeftArrow", action=act.Multiple{ + act.SendKey{key="l"}, + act.SendKey{key="e"}, + act.SendKey{key="f"}, + act.SendKey{key="t"} + }} } } ``` diff --git a/docs/config/lua/keyassignment/Nop.md b/docs/config/lua/keyassignment/Nop.md index dc95ecea9..0333c7071 100644 --- a/docs/config/lua/keyassignment/Nop.md +++ b/docs/config/lua/keyassignment/Nop.md @@ -7,10 +7,12 @@ If instead of this you want the key presses to pass through to the terminal, look at [DisableDefaultAssignment](DisableDefaultAssignment.md). ```lua +local wezterm = require 'wezterm' + return { keys = { -- Turn off any side effects from pressing CMD-m - {key="m", mods="CMD", action="Nop"}, + {key="m", mods="CMD", action=wezterm.action.Nop}, } } ``` diff --git a/docs/config/lua/keyassignment/OpenLinkAtMouseCursor.md b/docs/config/lua/keyassignment/OpenLinkAtMouseCursor.md index d037a8446..067c2ab3f 100644 --- a/docs/config/lua/keyassignment/OpenLinkAtMouseCursor.md +++ b/docs/config/lua/keyassignment/OpenLinkAtMouseCursor.md @@ -4,7 +4,7 @@ If the current mouse cursor position is over a cell that contains a hyperlink, this action causes that link to be opened. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { mouse_bindings = { @@ -12,7 +12,7 @@ return { { event={Up={streak=1, button="Left"}}, mods="CTRL", - action="OpenLinkAtMouseCursor", + action=wezterm.action.OpenLinkAtMouseCursor, }, }, } diff --git a/docs/config/lua/keyassignment/PaneSelect.md b/docs/config/lua/keyassignment/PaneSelect.md index d5892e3bc..07f6654eb 100644 --- a/docs/config/lua/keyassignment/PaneSelect.md +++ b/docs/config/lua/keyassignment/PaneSelect.md @@ -21,6 +21,7 @@ The selection alphabet defaults to the same value as [quick_select_alphabet](../ ```lua local wezterm = require 'wezterm' +local act = wezterm.action return { -- 36 is the default, but you can choose a different size @@ -28,11 +29,11 @@ return { keys = { -- activate pane selection mode with the default alphabet (labels are "a", "s", "d", "f" and so on) - {key="8", mods="CTRL", action=wezterm.action{PaneSelect={}}}, + {key="8", mods="CTRL", action=act.PaneSelect}, -- activate pane selection mode with numeric labels - {key="9", mods="CTRL", action=wezterm.action{PaneSelect={alphabet="1234567890"}}}, + {key="9", mods="CTRL", action=act.PaneSelect{alphabet="1234567890"}}, -- show the pane selection mode, but have it swap the active and selected panes - {key="0", mods="CTRL", action=wezterm.action{PaneSelect={mode="SwapWithActive"}}}, + {key="0", mods="CTRL", action=act.PaneSelect{mode="SwapWithActive"}}, } } ``` diff --git a/docs/config/lua/keyassignment/Paste.md b/docs/config/lua/keyassignment/Paste.md index 9de68ba9c..24f2c2d93 100644 --- a/docs/config/lua/keyassignment/Paste.md +++ b/docs/config/lua/keyassignment/Paste.md @@ -10,10 +10,11 @@ a future release; please use [PasteFrom](PasteFrom.md) instead. ## Example ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' + return { keys = { - {key="v", mods="SHIFT|CTRL", action="Paste"}, + {key="v", mods="SHIFT|CTRL", action=wezterm.action.Paste}, }, -- Middle mouse button pastes the clipboard. @@ -22,7 +23,7 @@ return { { event={Up={streak=1, button="Middle"}}, mods="NONE", - action="Paste", + action=wezterm.action.Paste, }, } } diff --git a/docs/config/lua/keyassignment/PasteFrom.md b/docs/config/lua/keyassignment/PasteFrom.md index 6a029ec8f..f6cc9f5a0 100644 --- a/docs/config/lua/keyassignment/PasteFrom.md +++ b/docs/config/lua/keyassignment/PasteFrom.md @@ -12,14 +12,16 @@ Possible values for source are: See also [Paste](Paste.md). ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action + return { keys = { -- paste from the clipboard - {key="V", mods="CTRL", action=wezterm.action{PasteFrom="Clipboard"}}, + {key="V", mods="CTRL", action=act.PasteFrom("Clipboard")}, -- paste from the primary selection - {key="V", mods="CTRL", action=wezterm.action{PasteFrom="PrimarySelection"}}, + {key="V", mods="CTRL", action=act.PasteFrom("PrimarySelection")}, }, } ``` diff --git a/docs/config/lua/keyassignment/PastePrimarySelection.md b/docs/config/lua/keyassignment/PastePrimarySelection.md index ae651cc22..24f3ed41b 100644 --- a/docs/config/lua/keyassignment/PastePrimarySelection.md +++ b/docs/config/lua/keyassignment/PastePrimarySelection.md @@ -11,10 +11,12 @@ a future release; please use [PasteFrom](PasteFrom.md) instead. ## Example ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.act + return { keys = { - {key="v", mods="SHIFT|CTRL", action="PastePrimarySelection"}, + {key="v", mods="SHIFT|CTRL", action=act.PastePrimarySelection}, }, -- Middle mouse button pastes the primary selection. @@ -22,7 +24,7 @@ return { { event={Up={streak=1, button="Middle"}}, mods="NONE", - action="PastePrimarySelection", + action=act.PastePrimarySelection, }, } } diff --git a/docs/config/lua/keyassignment/QuickSelect.md b/docs/config/lua/keyassignment/QuickSelect.md index 87b8e8adc..4578040e5 100644 --- a/docs/config/lua/keyassignment/QuickSelect.md +++ b/docs/config/lua/keyassignment/QuickSelect.md @@ -5,10 +5,11 @@ Activates [Quick Select Mode](../../../quickselect.md). ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' + return { keys = { - {key=" ", mods="SHIFT|CTRL", action="QuickSelect"}, + {key=" ", mods="SHIFT|CTRL", action=wezterm.action.QuickSelect}, } } ``` diff --git a/docs/config/lua/keyassignment/QuickSelectArgs.md b/docs/config/lua/keyassignment/QuickSelectArgs.md index 557b5c470..c2777fc51 100644 --- a/docs/config/lua/keyassignment/QuickSelectArgs.md +++ b/docs/config/lua/keyassignment/QuickSelectArgs.md @@ -16,11 +16,11 @@ local wezterm = require 'wezterm' return { keys = { {key="P", mods="CTRL", - action=wezterm.action{QuickSelectArgs={ + action=wezterm.action.QuickSelectArgs{ patterns={ "https?://\\S+" }, - }} + } }, }, } @@ -43,7 +43,7 @@ local wezterm = require 'wezterm' return { keys = { {key="P", mods="CTRL", - action=wezterm.action{QuickSelectArgs={ + action=wezterm.action.QuickSelectArgs{ label = "open url", patterns={ "https?://\\S+" @@ -53,7 +53,7 @@ return { wezterm.log_info("opening: " .. url) wezterm.open_with(url) end) - }} + } }, }, } diff --git a/docs/config/lua/keyassignment/QuitApplication.md b/docs/config/lua/keyassignment/QuitApplication.md index 8befa076a..a878b7197 100644 --- a/docs/config/lua/keyassignment/QuitApplication.md +++ b/docs/config/lua/keyassignment/QuitApplication.md @@ -3,9 +3,11 @@ Terminate the WezTerm application, killing all tabs. ```lua +local wezterm = require 'wezterm' + return { keys = { - {key="q", mods="CMD", action="QuitApplication"}, + {key="q", mods="CMD", action=wezterm.action.QuitApplication}, } } ``` diff --git a/docs/config/lua/keyassignment/ReloadConfiguration.md b/docs/config/lua/keyassignment/ReloadConfiguration.md index c98827cb8..333edbed7 100644 --- a/docs/config/lua/keyassignment/ReloadConfiguration.md +++ b/docs/config/lua/keyassignment/ReloadConfiguration.md @@ -3,9 +3,11 @@ Explicitly reload the configuration. ```lua +local wezterm = require 'wezterm' + return { keys = { - {key="r", mods="CMD|SHIFT", action="ReloadConfiguration"}, + {key="r", mods="CMD|SHIFT", action=wezterm.action.ReloadConfiguration}, } } ``` diff --git a/docs/config/lua/keyassignment/ResetFontAndWindowSize.md b/docs/config/lua/keyassignment/ResetFontAndWindowSize.md index cd342fef8..6ed8c7113 100644 --- a/docs/config/lua/keyassignment/ResetFontAndWindowSize.md +++ b/docs/config/lua/keyassignment/ResetFontAndWindowSize.md @@ -6,10 +6,11 @@ Reset both the font size and the terminal dimensions for the current window to the values specified by your `font`, `initial_rows`, and `initial_cols` configuration. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' + return { keys = { - {key="0", mods="CTRL", action="ResetFontAndWindowSize"}, + {key="0", mods="CTRL", action=wezterm.action.ResetFontAndWindowSize}, } } ``` diff --git a/docs/config/lua/keyassignment/ResetFontSize.md b/docs/config/lua/keyassignment/ResetFontSize.md index c31b1a3c2..9f77f6f7c 100644 --- a/docs/config/lua/keyassignment/ResetFontSize.md +++ b/docs/config/lua/keyassignment/ResetFontSize.md @@ -3,10 +3,11 @@ Reset the font size for the current window to the value in your configuration ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' + return { keys = { - {key="0", mods="CTRL", action="ResetFontSize"}, + {key="0", mods="CTRL", action=wezterm.action.ResetFontSize}, } } ``` diff --git a/docs/config/lua/keyassignment/RotatePanes.md b/docs/config/lua/keyassignment/RotatePanes.md index 7b1e24b21..d58bd098f 100644 --- a/docs/config/lua/keyassignment/RotatePanes.md +++ b/docs/config/lua/keyassignment/RotatePanes.md @@ -39,11 +39,12 @@ the panes withing those placements. ```lua local wezterm = require 'wezterm' +local act = wezterm.action return { keys = { - {key="b", mods="CTRL", action=wezterm.action{RotatePanes="CounterClockwise"}}, - {key="n", mods="CTRL", action=wezterm.action{RotatePanes="Clockwise"}}, + {key="b", mods="CTRL", action=act.RotatePanes("CounterClockwise")}, + {key="n", mods="CTRL", action=act.RotatePanes("Clockwise")}, }, } ``` diff --git a/docs/config/lua/keyassignment/ScrollByLine.md b/docs/config/lua/keyassignment/ScrollByLine.md index 80b0c86e0..ad25c8042 100644 --- a/docs/config/lua/keyassignment/ScrollByLine.md +++ b/docs/config/lua/keyassignment/ScrollByLine.md @@ -7,11 +7,12 @@ Negative values scroll upwards, while positive values scroll downwards. ```lua local wezterm = require 'wezterm'; +local act = wezterm.action return { keys = { - {key="UpArrow", mods="SHIFT", action=wezterm.action{ScrollByLine=-1}}, - {key="DownArrow", mods="SHIFT", action=wezterm.action{ScrollByLine=1}}, + {key="UpArrow", mods="SHIFT", action=act.ScrollByLine(-1)}, + {key="DownArrow", mods="SHIFT", action=act.ScrollByLine(1)}, } } ``` diff --git a/docs/config/lua/keyassignment/ScrollByPage.md b/docs/config/lua/keyassignment/ScrollByPage.md index af9fb85c3..bcf4a5e48 100644 --- a/docs/config/lua/keyassignment/ScrollByPage.md +++ b/docs/config/lua/keyassignment/ScrollByPage.md @@ -4,12 +4,13 @@ Adjusts the scroll position by the number of pages specified by the argument. Negative values scroll upwards, while positive values scroll downwards. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.act return { keys = { - {key="PageUp", mods="SHIFT", action=wezterm.action{ScrollByPage=-1}}, - {key="PageDown", mods="SHIFT", action=wezterm.action{ScrollByPage=1}}, + {key="PageUp", mods="SHIFT", action=act.ScrollByPage(-1)}, + {key="PageDown", mods="SHIFT", action=act.ScrollByPage(1)}, } } ``` @@ -24,8 +25,8 @@ local wezterm = require 'wezterm'; return { keys = { - {key="PageUp", mods="SHIFT", action=wezterm.action{ScrollByPage=-0.5}}, - {key="PageDown", mods="SHIFT", action=wezterm.action{ScrollByPage=0.5}}, + {key="PageUp", mods="SHIFT", action=act.ScrollByPage(-0.5)}, + {key="PageDown", mods="SHIFT", action=act.ScrollByPage(0.5)}, } } ``` diff --git a/docs/config/lua/keyassignment/ScrollToPrompt.md b/docs/config/lua/keyassignment/ScrollToPrompt.md index be5588075..c6d5b65f8 100644 --- a/docs/config/lua/keyassignment/ScrollToPrompt.md +++ b/docs/config/lua/keyassignment/ScrollToPrompt.md @@ -21,12 +21,13 @@ For the purposes of scrolling, the "current zone" is considered to be the one closest to the top of the viewport. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action return { keys = { - {key="UpArrow", mods="SHIFT", action=wezterm.action{ScrollToPrompt=-1}}, - {key="DownArrow", mods="SHIFT", action=wezterm.action{ScrollToPrompt=1}}, + {key="UpArrow", mods="SHIFT", action=act.ScrollToPrompt(-1)}, + {key="DownArrow", mods="SHIFT", action=act.ScrollToPrompt(1)}, } } ``` diff --git a/docs/config/lua/keyassignment/Search.md b/docs/config/lua/keyassignment/Search.md index 11f09f8d8..8a64b6a6d 100644 --- a/docs/config/lua/keyassignment/Search.md +++ b/docs/config/lua/keyassignment/Search.md @@ -12,15 +12,17 @@ here](https://docs.rs/regex/1.3.9/regex/#syntax). ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action + return { keys = { -- search for things that look like git hashes - {key="H", mods="SHIFT|CTRL", action=wezterm.action{Search={Regex="[a-f0-9]{6,}"}}}, + {key="H", mods="SHIFT|CTRL", action=act.Search{Regex="[a-f0-9]{6,}"}}, -- search for the lowercase string "hash" matching the case exactly - {key="H", mods="SHIFT|CTRL", action=wezterm.action{Search={CaseSensitiveString="hash"}}}, + {key="H", mods="SHIFT|CTRL", action=act.Search{CaseSensitiveString="hash"}}, -- search for the string "hash" matching regardless of case - {key="H", mods="SHIFT|CTRL", action=wezterm.action{Search={CaseInSensitiveString="hash"}}}, + {key="H", mods="SHIFT|CTRL", action=act.Search{CaseInSensitiveString="hash"}}, }, } ``` @@ -29,6 +31,6 @@ return { *since: 20220624-141144-bd1b7c5d* -You may now use `wezterm.action{Search="CurrentSelectionOrEmptyString"}` to have the search take the currently selected text as the item to search. +You may now use `wezterm.action.Search="CurrentSelectionOrEmptyString"}` to have the search take the currently selected text as the item to search. The selection text is adjusted to be a single line. diff --git a/docs/config/lua/keyassignment/SelectTextAtMouseCursor.md b/docs/config/lua/keyassignment/SelectTextAtMouseCursor.md index 2ebfe3fa1..f0ad29820 100644 --- a/docs/config/lua/keyassignment/SelectTextAtMouseCursor.md +++ b/docs/config/lua/keyassignment/SelectTextAtMouseCursor.md @@ -14,10 +14,12 @@ automatically select the entire command output when clicking on any character withing that region: ```lua +local wezterm = require 'wezterm' + return { mouse_bindings = { { event={Down={streak=3, button="Left"}}, - action={SelectTextAtMouseCursor="SemanticZone"}, + action=wezterm.action.SelectTextAtMouseCursor("SemanticZone"), mods="NONE" }, }, diff --git a/docs/config/lua/keyassignment/SendKey.md b/docs/config/lua/keyassignment/SendKey.md index c9c025ab7..858c79385 100644 --- a/docs/config/lua/keyassignment/SendKey.md +++ b/docs/config/lua/keyassignment/SendKey.md @@ -18,11 +18,14 @@ shells and applications. The following configuration achieves that same effect: ```lua +local wezterm = require 'wezterm' +local act = wezterm.act + return { keys = { -- Rebind OPT-Left, OPT-Right as ALT-b, ALT-f respectively to match Terminal.app behavior - {key="LeftArrow", mods="OPT", action={SendKey={key="b", mods="ALT"}}}, - {key="RightArrow", mods="OPT", action={SendKey={key="f", mods="ALT"}}}, + {key="LeftArrow", mods="OPT", action=act.SendKey{key="b", mods="ALT"}}, + {key="RightArrow", mods="OPT", action=act.SendKey{key="f", mods="ALT"}}, } } ``` diff --git a/docs/config/lua/keyassignment/SendString.md b/docs/config/lua/keyassignment/SendString.md index 3fd346e58..e409ed3a4 100644 --- a/docs/config/lua/keyassignment/SendString.md +++ b/docs/config/lua/keyassignment/SendString.md @@ -4,11 +4,11 @@ Sends the string specified argument to the terminal in the current tab, as though that text were literally typed into the terminal. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { keys = { - {key="m", mods="CMD", action=wezterm.action{SendString="Hello"}}, + {key="m", mods="CMD", action=wezterm.action.SendString("Hello")}, } } ``` @@ -20,14 +20,15 @@ keybinding for moving backwards/forwards through a word in a line editor. `\x1b` is the ESC character: ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.action return { keys = { -- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word - {key="LeftArrow", mods="OPT", action=wezterm.action{SendString="\x1bb"}}, + {key="LeftArrow", mods="OPT", action=act.SendString("\x1bb")}, -- Make Option-Right equivalent to Alt-f; forward-word - {key="RightArrow", mods="OPT", action=wezterm.action{SendString="\x1bf"}}, + {key="RightArrow", mods="OPT", action=act.SendString("\x1bf")}, } } ``` diff --git a/docs/config/lua/keyassignment/ShowDebugOverlay.md b/docs/config/lua/keyassignment/ShowDebugOverlay.md index 8733cdcae..52afb95d3 100644 --- a/docs/config/lua/keyassignment/ShowDebugOverlay.md +++ b/docs/config/lua/keyassignment/ShowDebugOverlay.md @@ -15,10 +15,12 @@ to dynamically assign event handlers for example. It is primarily useful for prototyping lua snippets before you integrate them fully into your config. ```lua +local wezterm = require 'wezterm' + return { keys = { -- CTRL-SHIFT-l activates the debug overlay - {key="L", mods="CTRL", action="ShowDebugOverlay"}, + {key="L", mods="CTRL", action=wezterm.action.ShowDebugOverlay}, } } ``` diff --git a/docs/config/lua/keyassignment/ShowLauncher.md b/docs/config/lua/keyassignment/ShowLauncher.md index a724388a6..af209902d 100644 --- a/docs/config/lua/keyassignment/ShowLauncher.md +++ b/docs/config/lua/keyassignment/ShowLauncher.md @@ -4,9 +4,11 @@ Activate the [Launcher Menu](../../launch.md#the-launcher-menu) in the current tab. ```lua +local wezterm = require 'wezterm' + return { keys = { - {key="l", mods="ALT", action="ShowLauncher"}, + {key="l", mods="ALT", action=wezterm.action.ShowLauncher}, } } ``` diff --git a/docs/config/lua/keyassignment/ShowLauncherArgs.md b/docs/config/lua/keyassignment/ShowLauncherArgs.md index c7162e415..f62ddfc6e 100644 --- a/docs/config/lua/keyassignment/ShowLauncherArgs.md +++ b/docs/config/lua/keyassignment/ShowLauncherArgs.md @@ -36,7 +36,7 @@ local wezterm = require 'wezterm' return { keys = { - {key="9", mods="ALT", action=wezterm.action{ShowLauncherArgs={flags="FUZZY|TABS"}}}, + {key="9", mods="ALT", action=wezterm.action.ShowLauncherArgs{flags="FUZZY|TABS"}}, }, } ``` diff --git a/docs/config/lua/keyassignment/ShowTabNavigator.md b/docs/config/lua/keyassignment/ShowTabNavigator.md index ee9130381..1ff713ea7 100644 --- a/docs/config/lua/keyassignment/ShowTabNavigator.md +++ b/docs/config/lua/keyassignment/ShowTabNavigator.md @@ -5,9 +5,11 @@ navigator displays a list of tabs and allows you to select and activate a tab from that list. ```lua +local wezterm = require 'wezterm' + return { keys = { - {key="F9", mods="ALT", action="ShowTabNavigator"}, + {key="F9", mods="ALT", action=wezterm.action.ShowTabNavigator}, } } ``` diff --git a/docs/config/lua/keyassignment/SpawnCommandInNewTab.md b/docs/config/lua/keyassignment/SpawnCommandInNewTab.md index 75148844a..41941740b 100644 --- a/docs/config/lua/keyassignment/SpawnCommandInNewTab.md +++ b/docs/config/lua/keyassignment/SpawnCommandInNewTab.md @@ -5,14 +5,14 @@ The argument is a `SpawnCommand` struct that is discussed in more detail in the [SpawnCommand](../SpawnCommand.md) docs. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { keys = { -- CMD-y starts `top` in a new window - {key="y", mods="CMD", action=wezterm.action{SpawnCommandInNewTab={ + {key="y", mods="CMD", action=wezterm.actionSpawnCommandInNewTab{ args={"top"} - }}}, + }}, } } ``` diff --git a/docs/config/lua/keyassignment/SpawnCommandInNewWindow.md b/docs/config/lua/keyassignment/SpawnCommandInNewWindow.md index d9293316d..d43a99f6b 100644 --- a/docs/config/lua/keyassignment/SpawnCommandInNewWindow.md +++ b/docs/config/lua/keyassignment/SpawnCommandInNewWindow.md @@ -5,14 +5,14 @@ The argument is a `SpawnCommand` struct that is discussed in more detail in the [SpawnCommand](../SpawnCommand.md) docs. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { keys = { -- CMD-y starts `top` in a new window - {key="y", mods="CMD", action=wezterm.action{SpawnCommandInNewWindow={ + {key="y", mods="CMD", action=wezterm.action.SpawnCommandInNewWindow{ args={"top"} - }}}, + }}, } } ``` diff --git a/docs/config/lua/keyassignment/SpawnTab.md b/docs/config/lua/keyassignment/SpawnTab.md index e747832fc..be0844bc6 100644 --- a/docs/config/lua/keyassignment/SpawnTab.md +++ b/docs/config/lua/keyassignment/SpawnTab.md @@ -3,16 +3,18 @@ Create a new tab in the current window. The argument defines to which *domain* the tab belongs: ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' +local act = wezterm.act + return { keys = { -- Create a new tab in the same domain as the current pane. -- This is usually what you want. - {key="t", mods="SHIFT|ALT", action=wezterm.action{SpawnTab="CurrentPaneDomain"}}, + {key="t", mods="SHIFT|ALT", action=act.SpawnTab("CurrentPaneDomain")}, -- Create a new tab in the default domain - {key="t", mods="SHIFT|ALT", action=wezterm.action{SpawnTab="DefaultDomain"}}, + {key="t", mods="SHIFT|ALT", action=act.SpawnTab("DefaultDomain")}, -- Create a tab in a named domain - {key="t", mods="SHIFT|ALT", action=wezterm.action{SpawnTab={DomainName="unix"}}}, + {key="t", mods="SHIFT|ALT", action=act.SpawnTab{DomainName="unix"}}, } } ``` diff --git a/docs/config/lua/keyassignment/SpawnWindow.md b/docs/config/lua/keyassignment/SpawnWindow.md index afce3c788..e0f8b97ee 100644 --- a/docs/config/lua/keyassignment/SpawnWindow.md +++ b/docs/config/lua/keyassignment/SpawnWindow.md @@ -3,10 +3,11 @@ Create a new window containing a tab from the default tab domain. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' + return { keys = { - {key="n", mods="SHIFT|CTRL", action="SpawnWindow"}, + {key="n", mods="SHIFT|CTRL", action=wezterm.action.SpawnWindow}, } } ``` diff --git a/docs/config/lua/keyassignment/SplitHorizontal.md b/docs/config/lua/keyassignment/SplitHorizontal.md index 35d013d4c..49fd7222f 100644 --- a/docs/config/lua/keyassignment/SplitHorizontal.md +++ b/docs/config/lua/keyassignment/SplitHorizontal.md @@ -6,13 +6,13 @@ Splits the current pane in half horizontally such that the current pane becomes the left half and the new right half spawns a new command. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { keys = { -- This will create a new split and run your default program inside it {key="%", mods="CTRL|SHIFT|ALT", - action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}}, + action=wezterm.action.SplitHorizontal{domain="CurrentPaneDomain"}}, } } ``` @@ -21,14 +21,14 @@ return { specify what should be spawned into the new split. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { keys = { -- This will create a new split and run the `top` program inside it - {key="%", mods="CTRL|SHIFT|ALT", action=wezterm.action{SplitHorizontal={ + {key="%", mods="CTRL|SHIFT|ALT", action=wezterm.action.SplitHorizontal{ args={"top"} - }}}, + }}, } } ``` diff --git a/docs/config/lua/keyassignment/SplitPane.md b/docs/config/lua/keyassignment/SplitPane.md index 4c4d8254b..6eea055dc 100644 --- a/docs/config/lua/keyassignment/SplitPane.md +++ b/docs/config/lua/keyassignment/SplitPane.md @@ -12,16 +12,16 @@ This assignment has a number of fields that control the overall action: * `top_level` - if set to `true`, rather than splitting the active pane, the split will be made at the root of the tab and effectively split the entire tab across the full extent possible. The default is `false`. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { keys = { -- This will create a new split and run the `top` program inside it - {key="%", mods="CTRL|SHIFT|ALT", action=wezterm.action{SplitPane={ + {key="%", mods="CTRL|SHIFT|ALT", action=wezterm.action.SplitPane{ direction="Left", command={args={"top"}}, size={Percent=50}, - }}}, + }}, } } ``` diff --git a/docs/config/lua/keyassignment/SplitVertical.md b/docs/config/lua/keyassignment/SplitVertical.md index 6ea61dc58..7649e4540 100644 --- a/docs/config/lua/keyassignment/SplitVertical.md +++ b/docs/config/lua/keyassignment/SplitVertical.md @@ -6,13 +6,13 @@ Splits the current pane in half vertically such that the current pane becomes the top half and the new bottom half spawns a new command. ```lua -local wezterm = require 'wezterm'; +local wezterm = require 'wezterm' return { keys = { -- This will create a new split and run your default program inside it {key="\"", mods="CTRL|SHIFT|ALT", - action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}}, + action=wezterm.action.SplitVertical{domain="CurrentPaneDomain"}}, } } ``` @@ -26,9 +26,9 @@ local wezterm = require 'wezterm'; return { keys = { -- This will create a new split and run the `top` program inside it - {key="\"", mods="CTRL|SHIFT|ALT", action=wezterm.action{SplitVertical={ + {key="\"", mods="CTRL|SHIFT|ALT", action=wezterm.action.SplitVertical{ args={"top"} - }}}, + }}, } } ``` diff --git a/docs/config/lua/keyassignment/StartWindowDrag.md b/docs/config/lua/keyassignment/StartWindowDrag.md index c1250c463..54b135819 100644 --- a/docs/config/lua/keyassignment/StartWindowDrag.md +++ b/docs/config/lua/keyassignment/StartWindowDrag.md @@ -8,17 +8,19 @@ move to follow your mouse pointer until the mouse button is released. By default this is bound to SUPER + left mouse drag, as well as CTRL-SHIFT + left mouse drag. ```lua +local wezterm = require 'wezterm' + return { mouse_bindings = { { event={Drag={streak=1, button="Left"}}, mods="SUPER", - action="StartWindowDrag" + action=wezterm.action.StartWindowDrag }, { event={Drag={streak=1, button="Left"}}, mods="CTRL|SHIFT", - action="StartWindowDrag" + action=wezterm.action.StartWindowDrag }, } } diff --git a/docs/config/lua/keyassignment/SwitchToWorkspace.md b/docs/config/lua/keyassignment/SwitchToWorkspace.md index 0ae6cefaf..9eb1c616d 100644 --- a/docs/config/lua/keyassignment/SwitchToWorkspace.md +++ b/docs/config/lua/keyassignment/SwitchToWorkspace.md @@ -11,6 +11,7 @@ Switch to a different workspace, creating it if it doesn't already exist. ```lua local wezterm = require 'wezterm' +local act = wezterm.action wezterm.on("update-right-status", function(window, pane) window:set_right_status(window:active_workspace()) @@ -19,23 +20,23 @@ end) return { keys = { -- Switch to the default workspace - {key="y", mods="CTRL|SHIFT", action=wezterm.action{SwitchToWorkspace={ + {key="y", mods="CTRL|SHIFT", action=act.SwitchToWorkspace{ name = "default" - }}}, + }}, -- Switch to a monitoring workspace, which will have `top` launched into it - {key="u", mods="CTRL|SHIFT", action=wezterm.action{SwitchToWorkspace={ + {key="u", mods="CTRL|SHIFT", action=act.SwitchToWorkspace{ name = "monitoring", spawn = { args = {"top"}, } - }}}, + }}, -- Create a new workspace with a random name and switch to it - {key="i", mods="CTRL|SHIFT", action=wezterm.action{SwitchToWorkspace={}}}, + {key="i", mods="CTRL|SHIFT", action=act.SwitchToWorkspace}, -- Show the launcher in fuzzy selection mode and have it list all workspaces -- and allow activating one. - {key="9", mods="ALT", action=wezterm.action{ShowLauncherArgs={ + {key="9", mods="ALT", action=act.ShowLauncherArgs{ flags="FUZZY|WORKSPACES" - }}}, + }}, }, } ``` diff --git a/docs/config/lua/keyassignment/SwitchWorkspaceRelative.md b/docs/config/lua/keyassignment/SwitchWorkspaceRelative.md index 987573ac4..e082d9652 100644 --- a/docs/config/lua/keyassignment/SwitchWorkspaceRelative.md +++ b/docs/config/lua/keyassignment/SwitchWorkspaceRelative.md @@ -15,6 +15,7 @@ to create workspaces. ```lua local wezterm = require 'wezterm' +local act = wezterm.action wezterm.on("update-right-status", function(window, pane) window:set_right_status(window:active_workspace()) @@ -22,9 +23,9 @@ end) return { keys = { - {key="9", mods="ALT", action=wezterm.action{ShowLauncherArgs={flags="FUZZY|WORKSPACES"}}}, - {key="n", mods="CTRL", action=wezterm.action{SwitchWorkspaceRelative=1}}, - {key="p", mods="CTRL", action=wezterm.action{SwitchWorkspaceRelative=-1}}, + {key="9", mods="ALT", action=act.ShowLauncherArgs{flags="FUZZY|WORKSPACES"}}, + {key="n", mods="CTRL", action=act.SwitchWorkspaceRelative(1)}, + {key="p", mods="CTRL", action=act.SwitchWorkspaceRelative(-1)}, }, } ``` diff --git a/docs/config/lua/keyassignment/ToggleFullScreen.md b/docs/config/lua/keyassignment/ToggleFullScreen.md index 9f08bb2bd..fad641c10 100644 --- a/docs/config/lua/keyassignment/ToggleFullScreen.md +++ b/docs/config/lua/keyassignment/ToggleFullScreen.md @@ -4,9 +4,11 @@ Toggles full screen mode for the current window. (But see: ) ```lua +local wezterm = require 'wezterm' + return { keys = { - {key="n", mods="SHIFT|CTRL", action="ToggleFullScreen"}, + {key="n", mods="SHIFT|CTRL", action=wezterm.action.ToggleFullScreen}, } } ``` diff --git a/docs/config/lua/keyassignment/TogglePaneZoomState.md b/docs/config/lua/keyassignment/TogglePaneZoomState.md index 9c750b160..994bedc79 100644 --- a/docs/config/lua/keyassignment/TogglePaneZoomState.md +++ b/docs/config/lua/keyassignment/TogglePaneZoomState.md @@ -7,9 +7,11 @@ all available space in the tab, hiding all other panes while it is zoomed. Switching its zoom state off will restore the prior split arrangement. ```lua +local wezterm = require 'wezterm' + return { keys = { - { key = "Z", mods="CTRL", action="TogglePaneZoomState" }, + { key = "Z", mods="CTRL", action=wezterm.action.TogglePaneZoomState }, } } ```