From 09e82b353a53bf1676ae3b1adbfb9835be9b76fb Mon Sep 17 00:00:00 2001 From: Italo Cunha Date: Sun, 5 Feb 2023 13:20:01 -0300 Subject: [PATCH] Add bindings for Home and End in copy_mode (#2762) * Add bindings for Home and End in copy_mode * Add Home/End bindings to copymode.md --------- Co-authored-by: Wez Furlong --- docs/copymode.md | 2 ++ docs/examples/default-copy-mode-key-table.markdown | 10 ++++++++++ wezterm-gui/src/overlay/copy.rs | 10 ++++++++++ 3 files changed, 22 insertions(+) diff --git a/docs/copymode.md b/docs/copymode.md index a695336b9..d7c46d7b3 100644 --- a/docs/copymode.md +++ b/docs/copymode.md @@ -55,8 +55,10 @@ The default key assignments in copy mode are as follows: | | b | | Move forward one word end | e (*since: nightly builds only*)| | Move to start of this line | 0 | +| | Home | | Move to start of next line | Enter | | Move to end of this line | $ | +| | End | | Move to start of indented line | Alt + M | | | ^ | | Move to bottom of scrollback | Shift + G | diff --git a/docs/examples/default-copy-mode-key-table.markdown b/docs/examples/default-copy-mode-key-table.markdown index 52c1552bf..a4e838a7a 100644 --- a/docs/examples/default-copy-mode-key-table.markdown +++ b/docs/examples/default-copy-mode-key-table.markdown @@ -36,12 +36,22 @@ return { mods = 'SHIFT', action = act.CopyMode 'MoveToEndOfLineContent', }, + { + key = 'End', + mods = 'SHIFT', + action = act.CopyMode 'MoveToEndOfLineContent', + }, { key = ',', mods = 'NONE', action = act.CopyMode 'JumpReverse' }, { key = '0', mods = 'NONE', action = act.CopyMode 'MoveToStartOfLine', }, + { + key = 'Home', + mods = 'NONE', + action = act.CopyMode 'MoveToStartOfLine', + }, { key = ';', mods = 'NONE', action = act.CopyMode 'JumpAgain' }, { key = 'F', diff --git a/wezterm-gui/src/overlay/copy.rs b/wezterm-gui/src/overlay/copy.rs index d781d1dda..5f5d3f646 100644 --- a/wezterm-gui/src/overlay/copy.rs +++ b/wezterm-gui/src/overlay/copy.rs @@ -1859,6 +1859,16 @@ pub fn copy_key_table() -> KeyTable { Modifiers::NONE, KeyAssignment::CopyMode(CopyModeAssignment::JumpForward { prev_char: true }), ), + ( + WKeyCode::Home, + Modifiers::NONE, + KeyAssignment::CopyMode(CopyModeAssignment::MoveToStartOfLine), + ), + ( + WKeyCode::End, + Modifiers::NONE, + KeyAssignment::CopyMode(CopyModeAssignment::MoveToEndOfLineContent), + ), ] { table.insert((key, mods), KeyTableEntry { action }); }