1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 21:32:13 +03:00

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 <wez@wezfurlong.org>
This commit is contained in:
Italo Cunha 2023-02-05 13:20:01 -03:00 committed by GitHub
parent 1609fd386b
commit 09e82b353a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View File

@ -55,8 +55,10 @@ The default key assignments in copy mode are as follows:
| | <kbd>b</kbd> |
| Move forward one word end | <kbd>e</kbd> (*since: nightly builds only*)|
| Move to start of this line | <kbd>0</kbd> |
| | <kbd>Home</kbd> |
| Move to start of next line | <kbd>Enter</kbd> |
| Move to end of this line | <kbd>$</kbd> |
| | <kbd>End</kbd> |
| Move to start of indented line | <kbd>Alt</kbd> + <kbd>M</kbd> |
| | <kbd>^</kbd> |
| Move to bottom of scrollback | <kbd>Shift</kbd> + <kbd>G</kbd> |

View File

@ -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',

View File

@ -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 });
}