diff --git a/docs/config/keys.markdown b/docs/config/keys.markdown index ea09461d5..a721f396e 100644 --- a/docs/config/keys.markdown +++ b/docs/config/keys.markdown @@ -491,6 +491,23 @@ return { } ``` +You can also emit escape sequences using `SendString`. This example shows +how to bind Alt-LeftArrow/RightArrow to the Alt-b/f, an emacs style +keybinding for moving backwards/forwards through a word in a line editor: + +```lua +local wezterm = require 'wezterm'; + +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"}}, + -- Make Option-Right equivalent to Alt-f; forward-word + {key="RightArrow", mods="OPT", action=wezterm.action{SendString="\x1bf"}}, + } +} +``` + ## DisableDefaultAssignment Has no special meaning of its own; this action will undo the registration