mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 05:42:03 +03:00
docs: Use new wezterm.action.Action
syntax in rest of the docs
This commit is contained in:
parent
ee5206db50
commit
cf4d5de854
@ -18,7 +18,8 @@ having to remember so many key combinations, so what we'd like to do is use
|
||||
modes, using `r` for resize and `a` for activation:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
-- Show which key table is active in the status area
|
||||
wezterm.on("update-right-status", function(window, pane)
|
||||
@ -27,28 +28,24 @@ wezterm.on("update-right-status", function(window, pane)
|
||||
name = "TABLE: " .. name
|
||||
end
|
||||
window:set_right_status(name or "")
|
||||
end);
|
||||
end)
|
||||
|
||||
return {
|
||||
leader = {key="Space", mods="CTRL|SHIFT"},
|
||||
keys = {
|
||||
-- CTRL|SHIFT+Space, followed by 'r' will put us in resize-pane
|
||||
-- CTRL+SHIFT+Space, followed by 'r' will put us in resize-pane
|
||||
-- mode until we cancel that mode.
|
||||
{key="r", mods="LEADER", action=wezterm.action{
|
||||
ActivateKeyTable={
|
||||
name="resize_pane",
|
||||
one_shot=false,
|
||||
}
|
||||
{key="r", mods="LEADER", action=act.ActivateKeyTable{
|
||||
name="resize_pane",
|
||||
one_shot=false,
|
||||
}},
|
||||
|
||||
-- CTRL|SHIFT+Space, followed by 'a' will put us in activate-pane
|
||||
-- CTRL+SHIFT+Space, followed by 'a' will put us in activate-pane
|
||||
-- mode until we press some other key or until 1 second (1000ms)
|
||||
-- of time elapses
|
||||
{key="a", mods="LEADER", action=wezterm.action{
|
||||
ActivateKeyTable={
|
||||
name="activate_pane",
|
||||
timeout_milliseconds=1000,
|
||||
}
|
||||
{key="a", mods="LEADER", action=act.ActivateKeyTable{
|
||||
name="activate_pane",
|
||||
timeout_milliseconds=1000,
|
||||
}},
|
||||
},
|
||||
|
||||
@ -60,17 +57,17 @@ return {
|
||||
-- 'resize_pane' here corresponds to the name="resize_pane" in
|
||||
-- the key assignments above.
|
||||
resize_pane = {
|
||||
{key="LeftArrow", action=wezterm.action{AdjustPaneSize={"Left", 1}}},
|
||||
{key="h", action=wezterm.action{AdjustPaneSize={"Left", 1}}},
|
||||
{key="LeftArrow", action=act.AdjustPaneSize{"Left", 1}},
|
||||
{key="h", action=act.AdjustPaneSize{"Left", 1}},
|
||||
|
||||
{key="RightArrow", action=wezterm.action{AdjustPaneSize={"Right", 1}}},
|
||||
{key="l", action=wezterm.action{AdjustPaneSize={"Right", 1}}},
|
||||
{key="RightArrow", action=act.AdjustPaneSize{"Right", 1}},
|
||||
{key="l", action=act.AdjustPaneSize{"Right", 1}},
|
||||
|
||||
{key="UpArrow", action=wezterm.action{AdjustPaneSize={"Up", 1}}},
|
||||
{key="k", action=wezterm.action{AdjustPaneSize={"Up", 1}}},
|
||||
{key="UpArrow", action=act.AdjustPaneSize{"Up", 1}},
|
||||
{key="k", action=act.AdjustPaneSize{"Up", 1}},
|
||||
|
||||
{key="DownArrow", action=wezterm.action{AdjustPaneSize={"Down", 1}}},
|
||||
{key="j", action=wezterm.action{AdjustPaneSize={"Down", 1}}},
|
||||
{key="DownArrow", action=act.AdjustPaneSize{"Down", 1}},
|
||||
{key="j", action=act.AdjustPaneSize{"Down", 1}},
|
||||
|
||||
-- Cancel the mode by pressing escape
|
||||
{key="Escape", action="PopKeyTable"},
|
||||
@ -81,17 +78,17 @@ return {
|
||||
-- 'activate_pane' here corresponds to the name="activate_pane" in
|
||||
-- the key assignments above.
|
||||
activate_pane = {
|
||||
{key="LeftArrow", action=wezterm.action{ActivatePaneDirection="Left"}},
|
||||
{key="h", action=wezterm.action{ActivatePaneDirection="Left"}},
|
||||
{key="LeftArrow", action=act.ActivatePaneDirection("Left")},
|
||||
{key="h", action=act.ActivatePaneDirection("Left")},
|
||||
|
||||
{key="RightArrow", action=wezterm.action{ActivatePaneDirection="Right"}},
|
||||
{key="l", action=wezterm.action{ActivatePaneDirection="Right"}},
|
||||
{key="RightArrow", action=act.ActivatePaneDirection("Right")},
|
||||
{key="l", action=act.ActivatePaneDirection("Right")},
|
||||
|
||||
{key="UpArrow", action=wezterm.action{ActivatePaneDirection="Up"}},
|
||||
{key="k", action=wezterm.action{ActivatePaneDirection="Up"}},
|
||||
{key="UpArrow", action=act.ActivatePaneDirection("Up")},
|
||||
{key="k", action=act.ActivatePaneDirection("Up")},
|
||||
|
||||
{key="DownArrow", action=wezterm.action{ActivatePaneDirection="Down"}},
|
||||
{key="j", action=wezterm.action{ActivatePaneDirection="Down"}},
|
||||
{key="DownArrow", action=act.ActivatePaneDirection("Down")},
|
||||
{key="j", action=act.ActivatePaneDirection("Down")},
|
||||
},
|
||||
|
||||
},
|
||||
|
@ -143,9 +143,9 @@ return {
|
||||
-- timeout_milliseconds defaults to 1000 and can be omitted
|
||||
leader = { key="a", mods="CTRL", timeout_milliseconds=1000 },
|
||||
keys = {
|
||||
{key="|", mods="LEADER|SHIFT", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}},
|
||||
{key="|", mods="LEADER|SHIFT", action=wezterm.action.SplitHorizontal{domain="CurrentPaneDomain"}},
|
||||
-- Send "CTRL-A" to the terminal when pressing CTRL-A, CTRL-A
|
||||
{key="a", mods="LEADER|CTRL", action=wezterm.action{SendString="\x01"}},
|
||||
{key="a", mods="LEADER|CTRL", action=wezterm.action.SendString("\x01")},
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -168,8 +168,8 @@ return {
|
||||
-- for this example use `setxkbmap -option caps:none` in your terminal.
|
||||
leader = { key="VoidSymbol", mods="", timeout_milliseconds=1000 },
|
||||
keys = {
|
||||
{key="|", mods="LEADER|SHIFT", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}},
|
||||
{key="-", mods="LEADER", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}},
|
||||
{key="|", mods="LEADER|SHIFT", action=wezterm.action.SplitHorizontal{domain="CurrentPaneDomain"}},
|
||||
{key="-", mods="LEADER", action=wezterm.action.SplitVertical{domain="CurrentPaneDomain"}},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -22,13 +22,15 @@ return {
|
||||
if has_selection then
|
||||
window:perform_action(
|
||||
act.CopyTo("ClipboardAndPrimarySelection"),
|
||||
pane)
|
||||
pane,
|
||||
)
|
||||
|
||||
window:perform_action("ClearSelection", pane)
|
||||
window:perform_action(act.ClearSelection, pane)
|
||||
else
|
||||
window:perform_action(
|
||||
act.SendKey{key="c", mods="CTRL"}},
|
||||
pane)
|
||||
act.SendKey{key="c", mods="CTRL"},
|
||||
pane,
|
||||
)
|
||||
end
|
||||
end)
|
||||
}
|
||||
|
@ -2,10 +2,14 @@
|
||||
|
||||
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.
|
||||
|
||||
*Since: 20220624-141144-bd1b7c5d*
|
||||
|
||||
The mode argument can also be `"Block"` to enable a rectangular block selection.
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm'
|
||||
local wezterm = require "wezterm"
|
||||
|
||||
return {
|
||||
mouse_bindings = {
|
||||
@ -21,13 +25,14 @@ return {
|
||||
It is also possible to leave the mode unspecified like this:
|
||||
|
||||
```lua
|
||||
local wezterm = require "wezterm"
|
||||
|
||||
return {
|
||||
mouse_bindings = {
|
||||
{
|
||||
event={Up={streak=1, button="Left"}},
|
||||
mods="SHIFT",
|
||||
-- Note that there is no `wezterm.action` here
|
||||
action={ExtendSelectionToMouseCursor={}},
|
||||
action=wezterm.action.ExtendSelectionToMouseCursor(nil),
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -36,7 +41,3 @@ return {
|
||||
when unspecified, wezterm will use a default mode which at the time
|
||||
of writing is `Cell`, but in a future release may be context sensitive
|
||||
based on recent actions.
|
||||
|
||||
*Since: 20220624-141144-bd1b7c5d*
|
||||
|
||||
The mode argument can also be `"Block"` to enable a rectangular block selection.
|
||||
|
@ -11,5 +11,3 @@ return {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
@ -11,5 +11,3 @@ return {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
@ -11,5 +11,3 @@ return {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
@ -6,7 +6,6 @@ from the left, and so on.
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
local mykeys = {}
|
||||
for i = 1, 8 do
|
||||
@ -14,7 +13,7 @@ for i = 1, 8 do
|
||||
table.insert(mykeys, {
|
||||
key=tostring(i),
|
||||
mods="CTRL|ALT",
|
||||
action=act.MoveTab(i-1),
|
||||
action=wezterm.action.MoveTab(i - 1),
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -31,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.
|
||||
|
@ -10,7 +10,7 @@ local wezterm = require 'wezterm'
|
||||
return {
|
||||
keys = {
|
||||
-- CMD-y starts `top` in a new window
|
||||
{key="y", mods="CMD", action=wezterm.actionSpawnCommandInNewTab{
|
||||
{key="y", mods="CMD", action=wezterm.action.SpawnCommandInNewTab{
|
||||
args={"top"}
|
||||
}},
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ return {
|
||||
|
||||
## Older versions
|
||||
|
||||
Usage looks like this:
|
||||
For versions before *20220624-141144-bd1b7c5d*, usage looks like this:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
|
@ -12,7 +12,7 @@ The implementation is essentially the same as:
|
||||
function wezterm.action_callback(callback)
|
||||
local event_id = "..." -- the function generates a unique event id
|
||||
wezterm.on(event_id, callback)
|
||||
return wezterm.action{EmitEvent=event_id}
|
||||
return wezterm.action.EmitEvent(event_id)
|
||||
end
|
||||
```
|
||||
|
||||
|
@ -10,15 +10,15 @@ For example, if you prefer to launch your preferred MUA in a new window
|
||||
in response to clicking on `mailto:` URLs, you could do something like:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local wezterm = require "wezterm"
|
||||
|
||||
wezterm.on("open-uri", function(window, pane, uri)
|
||||
local start, match_end = uri:find("mailto:")
|
||||
if start == 1 then
|
||||
local recipient = uri:sub(match_end+1)
|
||||
window:perform_action(wezterm.action{SpawnCommandInNewWindow={
|
||||
args={"mutt", recipient}
|
||||
}}, pane);
|
||||
window:perform_action(wezterm.action.SpawnCommandInNewWindow{
|
||||
args={"mutt", recipient}
|
||||
}, pane)
|
||||
-- prevent the default action from opening in a browser
|
||||
return false
|
||||
end
|
||||
|
@ -16,7 +16,7 @@ end)
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="9", mods="ALT", action=wezterm.action{ShowLauncherArgs={flags="FUZZY|WORKSPACES"}}},
|
||||
{key="9", mods="ALT", action=wezterm.action.ShowLauncherArgs{flags="FUZZY|WORKSPACES"}},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -23,7 +23,7 @@ end)
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="E", mods="CTRL", action=wezterm.action{EmitEvent="show-font-size"}},
|
||||
{key="E", mods="CTRL", action=wezterm.action.EmitEvent("show-font-size")},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -23,7 +23,7 @@ end)
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="E", mods="CTRL", action=wezterm.action{EmitEvent="log-selection"}},
|
||||
{key="E", mods="CTRL", action=wezterm.action.EmitEvent("log-selection")},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -12,5 +12,4 @@ The first parameter is a key assignment such as that returned by [`wezterm.actio
|
||||
|
||||
The second parameter is a `pane` object passed to your event callback.
|
||||
|
||||
For an example of this method in action, see [`wezterm.on Custom Events`](../wezterm/on.md#custom-events).
|
||||
|
||||
For an example of this method in action, see [`wezterm.on` Custom Events](../wezterm/on.md#custom-events).
|
||||
|
@ -37,7 +37,7 @@ end)
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="E", mods="CTRL", action=wezterm.action{EmitEvent="toggle-ligature"}},
|
||||
{key="E", mods="CTRL", action=wezterm.action.EmitEvent("toggle-ligature")},
|
||||
},
|
||||
}
|
||||
```
|
||||
@ -60,7 +60,7 @@ end)
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{key="B", mods="CTRL", action=wezterm.action{EmitEvent="toggle-opacity"}},
|
||||
{key="B", mods="CTRL", action=wezterm.action.EmitEvent("toggle-opacity")},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -26,27 +26,29 @@ of that triple click, so for a triple click both
|
||||
`SelectTextAtMouseCursor="Line"` and `CompleteSelection` will be triggered in
|
||||
that order.
|
||||
|
||||
NOTE: In the action column, `act` is an alias to `wezterm.action` (to avoid repetition).
|
||||
|
||||
| Event | Modifiers | Action |
|
||||
| --------- | --- | ------ |
|
||||
| Triple Left Down | `NONE` | `SelectTextAtMouseCursor="Line"` |
|
||||
| Double Left Down | `NONE` | `SelectTextAtMouseCursor="Word"` |
|
||||
| Single Left Down | `NONE` | `SelectTextAtMouseCursor="Cell"` |
|
||||
| Single Left Down | `SHIFT` | `ExtendSelectionToMouseCursor={}` |
|
||||
| Single Left Down | `ALT` | `SelectTextAtMouseCursor="Block"` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Single Left Up | `SHIFT` | `CompleteSelectionOrOpenLinkAtMouseCursor="PrimarySelection"` |
|
||||
| Single Left Up | `NONE` | `CompleteSelectionOrOpenLinkAtMouseCursor="PrimarySelection"` |
|
||||
| Single Left Up | `ALT` | `CompleteSelection="PrimarySelection"` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Double Left Up | `NONE` | `CompleteSelection="PrimarySelection"` |
|
||||
| Triple Left Up | `NONE` | `CompleteSelection="PrimarySelection"` |
|
||||
| Single Left Drag | `NONE` | `ExtendSelectionToMouseCursor="Cell"` |
|
||||
| Single Left Drag | `ALT` | `ExtendSelectionToMouseCursor="Block"` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Single Left Down | `ALT+SHIFT` | `ExtendSelectionToMouseCursor="Block"` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Single Left Up | `ALT+SHIFT` | `CompleteSelection="PrimarySelection"` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Double Left Drag | `NONE` | `ExtendSelectionToMouseCursor="Word"` |
|
||||
| Triple Left Drag | `NONE` | `ExtendSelectionToMouseCursor="Line"` |
|
||||
| Single Middle Down | `NONE` | `PasteFrom="PrimarySelection"` |
|
||||
| Single Left Drag | `SUPER` | `StartWindowDrag` (*since 20210314-114017-04b7cedd*) |
|
||||
| Single Left Drag | `CTRL+SHIFT` | `StartWindowDrag` (*since 20210314-114017-04b7cedd*) |
|
||||
| Triple Left Down | `NONE` | `act.SelectTextAtMouseCursor("Line")` |
|
||||
| Double Left Down | `NONE` | `act.SelectTextAtMouseCursor("Word")` |
|
||||
| Single Left Down | `NONE` | `act.SelectTextAtMouseCursor("Cell")` |
|
||||
| Single Left Down | `SHIFT` | `act.ExtendSelectionToMouseCursor("Cell")` |
|
||||
| Single Left Down | `ALT` | `act.SelectTextAtMouseCursor("Block")` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Single Left Up | `SHIFT` | `act.CompleteSelectionOrOpenLinkAtMouseCursor("PrimarySelection")` |
|
||||
| Single Left Up | `NONE` | `act.CompleteSelectionOrOpenLinkAtMouseCursor("PrimarySelection")` |
|
||||
| Single Left Up | `ALT` | `act.CompleteSelection("PrimarySelection")` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Double Left Up | `NONE` | `act.CompleteSelection("PrimarySelection")` |
|
||||
| Triple Left Up | `NONE` | `act.CompleteSelection("PrimarySelection")` |
|
||||
| Single Left Drag | `NONE` | `act.ExtendSelectionToMouseCursor("Cell")` |
|
||||
| Single Left Drag | `ALT` | `act.ExtendSelectionToMouseCursor("Block")` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Single Left Down | `ALT+SHIFT` | `act.ExtendSelectionToMouseCursor("Block")` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Single Left Up | `ALT+SHIFT` | `act.CompleteSelection("PrimarySelection")` (*since: 20220624-141144-bd1b7c5d*) |
|
||||
| Double Left Drag | `NONE` | `act.ExtendSelectionToMouseCursor("Word")` |
|
||||
| Triple Left Drag | `NONE` | `act.ExtendSelectionToMouseCursor("Line")` |
|
||||
| Single Middle Down | `NONE` | `act.PasteFrom("PrimarySelection")` |
|
||||
| Single Left Drag | `SUPER` | `act.StartWindowDrag` (*since 20210314-114017-04b7cedd*) |
|
||||
| Single Left Drag | `CTRL+SHIFT` | `act.StartWindowDrag` (*since 20210314-114017-04b7cedd*) |
|
||||
|
||||
If you don't want the default assignments to be registered, you can
|
||||
disable all of them with this configuration; if you chose to do this,
|
||||
@ -66,6 +68,7 @@ You can define mouse actions using the `mouse_bindings` configuration section:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm';
|
||||
local act = wezterm.action
|
||||
|
||||
return {
|
||||
mouse_bindings = {
|
||||
@ -73,7 +76,7 @@ return {
|
||||
{
|
||||
event={Down={streak=1, button="Right"}},
|
||||
mods="NONE",
|
||||
action=wezterm.action{SendString="woot"}
|
||||
action=act.SendString("woot"),
|
||||
},
|
||||
|
||||
-- Change the default click behavior so that it only selects
|
||||
@ -81,14 +84,14 @@ return {
|
||||
{
|
||||
event={Up={streak=1, button="Left"}},
|
||||
mods="NONE",
|
||||
action=wezterm.action{CompleteSelection="PrimarySelection"},
|
||||
action=act.CompleteSelection("PrimarySelection"),
|
||||
},
|
||||
|
||||
-- and make CTRL-Click open hyperlinks
|
||||
{
|
||||
event={Up={streak=1, button="Left"}},
|
||||
mods="CTRL",
|
||||
action="OpenLinkAtMouseCursor",
|
||||
action=act.OpenLinkAtMouseCursor,
|
||||
},
|
||||
-- NOTE that binding only the 'Up' event can give unexpected behaviors.
|
||||
-- Read more below on the gotcha of binding an 'Up' event only.
|
||||
@ -133,19 +136,22 @@ event, but not the 'Up' event (which is bound to something in your config).
|
||||
To avoid this, it is recommended to disable the 'Down' event (to ensure it won't
|
||||
be sent to the running program), for example:
|
||||
```lua
|
||||
local wezterm = require "wezterm"
|
||||
local act = wezterm.action
|
||||
|
||||
return {
|
||||
mouse_bindings = {
|
||||
-- Bind 'Up' event of CTRL-Click to open hyperlinks
|
||||
{
|
||||
event={Up={streak=1, button="Left"}},
|
||||
mods="CTRL",
|
||||
action="OpenLinkAtMouseCursor",
|
||||
action=act.OpenLinkAtMouseCursor,
|
||||
},
|
||||
-- Disable the 'Down' event of CTRL-Click to avoid weird program behaviors
|
||||
{
|
||||
event={Down={streak=1, button="Left"}},
|
||||
mods="CTRL",
|
||||
action="Nop",
|
||||
action=act.Nop,
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -156,5 +162,3 @@ return {
|
||||
|
||||
See the [`KeyAssignment` reference](lua/keyassignment/index.md) for information
|
||||
on available actions.
|
||||
|
||||
|
||||
|
100
docs/copymode.md
100
docs/copymode.md
@ -81,72 +81,72 @@ The default configuration is equivalent to:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
return {
|
||||
key_tables = {
|
||||
copy_mode = {
|
||||
{key="c", mods="CTRL", action=wezterm.action{CopyMode="Close"}},
|
||||
{key="g", mods="CTRL", action=wezterm.action{CopyMode="Close"}},
|
||||
{key="q", mods="NONE", action=wezterm.action{CopyMode="Close"}},
|
||||
{key="Escape", mods="NONE", action=wezterm.action{CopyMode="Close"}},
|
||||
{key="c", mods="CTRL", action=act.CopyMode("Close")},
|
||||
{key="g", mods="CTRL", action=act.CopyMode("Close")},
|
||||
{key="q", mods="NONE", action=act.CopyMode("Close")},
|
||||
{key="Escape", mods="NONE", action=act.CopyMode("Close")},
|
||||
|
||||
{key="h", mods="NONE", action=wezterm.action{CopyMode="MoveLeft"}},
|
||||
{key="j", mods="NONE", action=wezterm.action{CopyMode="MoveDown"}},
|
||||
{key="k", mods="NONE", action=wezterm.action{CopyMode="MoveUp"}},
|
||||
{key="l", mods="NONE", action=wezterm.action{CopyMode="MoveRight"}},
|
||||
{key="h", mods="NONE", action=act.CopyMode("MoveLeft")},
|
||||
{key="j", mods="NONE", action=act.CopyMode("MoveDown")},
|
||||
{key="k", mods="NONE", action=act.CopyMode("MoveUp")},
|
||||
{key="l", mods="NONE", action=act.CopyMode("MoveRight")},
|
||||
|
||||
{key="LeftArrow", mods="NONE", action=wezterm.action{CopyMode="MoveLeft"}},
|
||||
{key="DownArrow", mods="NONE", action=wezterm.action{CopyMode="MoveDown"}},
|
||||
{key="UpArrow", mods="NONE", action=wezterm.action{CopyMode="MoveUp"}},
|
||||
{key="RightArrow", mods="NONE", action=wezterm.action{CopyMode="MoveRight"}},
|
||||
{key="LeftArrow", mods="NONE", action=act.CopyMode("MoveLeft")},
|
||||
{key="DownArrow", mods="NONE", action=act.CopyMode("MoveDown")},
|
||||
{key="UpArrow", mods="NONE", action=act.CopyMode("MoveUp")},
|
||||
{key="RightArrow", mods="NONE", action=act.CopyMode("MoveRight")},
|
||||
|
||||
{key="RightArrow", mods="ALT", action=wezterm.action{CopyMode="MoveForwardWord"}},
|
||||
{key="f", mods="ALT", action=wezterm.action{CopyMode="MoveForwardWord"}},
|
||||
{key="Tab", mods="NONE", action=wezterm.action{CopyMode="MoveForwardWord"}},
|
||||
{key="w", mods="NONE", action=wezterm.action{CopyMode="MoveForwardWord"}},
|
||||
{key="RightArrow", mods="ALT", action=act.CopyMode("MoveForwardWord")},
|
||||
{key="f", mods="ALT", action=act.CopyMode("MoveForwardWord")},
|
||||
{key="Tab", mods="NONE", action=act.CopyMode("MoveForwardWord")},
|
||||
{key="w", mods="NONE", action=act.CopyMode("MoveForwardWord")},
|
||||
|
||||
{key="LeftArrow", mods="ALT", action=wezterm.action{CopyMode="MoveBackwardWord"}},
|
||||
{key="b", mods="ALT", action=wezterm.action{CopyMode="MoveBackwardWord"}},
|
||||
{key="Tab", mods="SHIFT", action=wezterm.action{CopyMode="MoveBackwardWord"}},
|
||||
{key="b", mods="NONE", action=wezterm.action{CopyMode="MoveBackwardWord"}},
|
||||
{key="LeftArrow", mods="ALT", action=act.CopyMode("MoveBackwardWord")},
|
||||
{key="b", mods="ALT", action=act.CopyMode("MoveBackwardWord")},
|
||||
{key="Tab", mods="SHIFT", action=act.CopyMode("MoveBackwardWord")},
|
||||
{key="b", mods="NONE", action=act.CopyMode("MoveBackwardWord")},
|
||||
|
||||
{key="0", mods="NONE", action=wezterm.action{CopyMode="MoveToStartOfLine"}},
|
||||
{key="Enter", mods="NONE", action=wezterm.action{CopyMode="MoveToStartOfNextLine"}},
|
||||
{key="$", mods="NONE", action=wezterm.action{CopyMode="MoveToEndOfLineContent"}},
|
||||
{key="$", mods="SHIFT", action=wezterm.action{CopyMode="MoveToEndOfLineContent"}},
|
||||
{key="0", mods="NONE", action=act.CopyMode("MoveToStartOfLine")},
|
||||
{key="Enter", mods="NONE", action=act.CopyMode("MoveToStartOfNextLine")},
|
||||
|
||||
{key="m", mods="ALT", action=wezterm.action{CopyMode="MoveToStartOfLineContent"}},
|
||||
{key="^", mods="NONE", action=wezterm.action{CopyMode="MoveToStartOfLineContent"}},
|
||||
{key="^", mods="SHIFT", action=wezterm.action{CopyMode="MoveToStartOfLineContent"}},
|
||||
{key="$", mods="NONE", action=act.CopyMode("MoveToEndOfLineContent")},
|
||||
{key="$", mods="SHIFT", action=act.CopyMode("MoveToEndOfLineContent")},
|
||||
{key="^", mods="NONE", action=act.CopyMode("MoveToStartOfLineContent")},
|
||||
{key="^", mods="SHIFT", action=act.CopyMode("MoveToStartOfLineContent")},
|
||||
{key="m", mods="ALT", action=act.CopyMode("MoveToStartOfLineContent")},
|
||||
|
||||
{key=" ", mods="NONE", action=wezterm.action{CopyMode={SetSelectionMode="Cell"}}},
|
||||
{key="v", mods="NONE", action=wezterm.action{CopyMode={SetSelectionMode="Cell"}}},
|
||||
{key="V", mods="NONE", action=wezterm.action{CopyMode={SetSelectionMode="Line"}}},
|
||||
{key="V", mods="SHIFT", action=wezterm.action{CopyMode={SetSelectionMode="Line"}}},
|
||||
{key="v", mods="CTRL", action=wezterm.action{CopyMode={SetSelectionMode="Block"}}},
|
||||
{key=" ", mods="NONE", action=act.CopyMode{SetSelectionMode="Cell"}},
|
||||
{key="v", mods="NONE", action=act.CopyMode{SetSelectionMode="Cell"}},
|
||||
{key="V", mods="NONE", action=act.CopyMode{SetSelectionMode="Line"}},
|
||||
{key="V", mods="SHIFT", action=act.CopyMode{SetSelectionMode="Line"}},
|
||||
{key="v", mods="CTRL", action=act.CopyMode{SetSelectionMode="Block"}},
|
||||
|
||||
{key="G", mods="NONE", action=wezterm.action{CopyMode="MoveToScrollbackBottom"}},
|
||||
{key="G", mods="SHIFT", action=wezterm.action{CopyMode="MoveToScrollbackBottom"}},
|
||||
{key="g", mods="NONE", action=wezterm.action{CopyMode="MoveToScrollbackTop"}},
|
||||
{key="G", mods="NONE", action=act.CopyMode("MoveToScrollbackBottom")},
|
||||
{key="G", mods="SHIFT", action=act.CopyMode("MoveToScrollbackBottom")},
|
||||
{key="g", mods="NONE", action=act.CopyMode("MoveToScrollbackTop")},
|
||||
|
||||
{key="H", mods="NONE", action=wezterm.action{CopyMode="MoveToViewportTop"}},
|
||||
{key="H", mods="SHIFT", action=wezterm.action{CopyMode="MoveToViewportTop"}},
|
||||
{key="M", mods="NONE", action=wezterm.action{CopyMode="MoveToViewportMiddle"}},
|
||||
{key="M", mods="SHIFT", action=wezterm.action{CopyMode="MoveToViewportMiddle"}},
|
||||
{key="L", mods="NONE", action=wezterm.action{CopyMode="MoveToViewportBottom"}},
|
||||
{key="L", mods="SHIFT", action=wezterm.action{CopyMode="MoveToViewportBottom"}},
|
||||
{key="H", mods="NONE", action=act.CopyMode("MoveToViewportTop")},
|
||||
{key="H", mods="SHIFT", action=act.CopyMode("MoveToViewportTop")},
|
||||
{key="M", mods="NONE", action=act.CopyMode("MoveToViewportMiddle")},
|
||||
{key="M", mods="SHIFT", action=act.CopyMode("MoveToViewportMiddle")},
|
||||
{key="L", mods="NONE", action=act.CopyMode("MoveToViewportBottom")},
|
||||
{key="L", mods="SHIFT", action=act.CopyMode("MoveToViewportBottom")},
|
||||
|
||||
{key="o", mods="NONE", action=wezterm.action{CopyMode="MoveToSelectionOtherEnd"}},
|
||||
{key="O", mods="NONE", action=wezterm.action{CopyMode="MoveToSelectionOtherEndHoriz"}},
|
||||
{key="O", mods="SHIFT", action=wezterm.action{CopyMode="MoveToSelectionOtherEndHoriz"}},
|
||||
{key="o", mods="NONE", action=act.CopyMode("MoveToSelectionOtherEnd")},
|
||||
{key="O", mods="NONE", action=act.CopyMode("MoveToSelectionOtherEndHoriz")},
|
||||
{key="O", mods="SHIFT", action=act.CopyMode("MoveToSelectionOtherEndHoriz")},
|
||||
|
||||
{key="PageUp", mods="NONE", action=wezterm.action{CopyMode="PageUp"}},
|
||||
{key="PageDown", mods="NONE", action=wezterm.action{CopyMode="PageDown"}},
|
||||
{key="PageUp", mods="NONE", action=act.CopyMode("PageUp")},
|
||||
{key="PageDown", mods="NONE", action=act.CopyMode("PageDown")},
|
||||
|
||||
{key="b", mods="CTRL", action=wezterm.action{CopyMode="PageUp"}},
|
||||
{key="f", mods="CTRL", action=wezterm.action{CopyMode="PageDown"}},
|
||||
}
|
||||
{key="b", mods="CTRL", action=act.CopyMode("PageUp")},
|
||||
{key="f", mods="CTRL", action=act.CopyMode("PageDown")},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -98,20 +98,21 @@ The default configuration is equivalent to:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
return {
|
||||
key_tables = {
|
||||
search_mode = {
|
||||
{key="Escape", mods="NONE", action=wezterm.action{CopyMode="Close"}},
|
||||
{key="UpArrow", mods="NONE", action=wezterm.action{CopyMode="PriorMatch"}},
|
||||
{key="Enter", mods="NONE", action=wezterm.action{CopyMode="PriorMatch"}},
|
||||
{key="p", mods="CTRL", action=wezterm.action{CopyMode="PriorMatch"}},
|
||||
{key="PageUp", mods="NONE", action=wezterm.action{CopyMode="PriorMatchPage"}},
|
||||
{key="PageDown", mods="NONE", action=wezterm.action{CopyMode="NextMatchPage"}},
|
||||
{key="n", mods="CTRL", action=wezterm.action{CopyMode="NextMatchPage"}},
|
||||
{key="DownArrow", mods="NONE", action=wezterm.action{CopyMode="NextMatch"}},
|
||||
{key="r", mods="CTRL", action=wezterm.action{CopyMode="CycleMatchType"}},
|
||||
{key="u", mods="CTRL", action=wezterm.action{CopyMode="ClearPattern"}},
|
||||
{key="Escape", mods="NONE", action=act.CopyMode("Close")},
|
||||
{key="UpArrow", mods="NONE", action=act.CopyMode("PriorMatch")},
|
||||
{key="Enter", mods="NONE", action=act.CopyMode("PriorMatch")},
|
||||
{key="p", mods="CTRL", action=act.CopyMode("PriorMatch")},
|
||||
{key="PageUp", mods="NONE", action=act.CopyMode("PriorMatchPage")},
|
||||
{key="PageDown", mods="NONE", action=act.CopyMode("NextMatchPage")},
|
||||
{key="n", mods="CTRL", action=act.CopyMode("NextMatchPage")},
|
||||
{key="DownArrow", mods="NONE", action=act.CopyMode("NextMatch")},
|
||||
{key="r", mods="CTRL", action=act.CopyMode("CycleMatchType")},
|
||||
{key="u", mods="CTRL", action=act.CopyMode("ClearPattern")},
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -135,7 +136,7 @@ local wezterm = require 'wezterm';
|
||||
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=wezterm.action.Search{Regex="[a-f0-9]{6,}"}},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user