From cbd2e81a7ef0fc0a65ec1d55a5c35a3947bade03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20G=C3=B3mez-Londo=C3=B1o?= Date: Fri, 20 Dec 2024 14:49:12 +0100 Subject: [PATCH] Add arrow key movements to terminal vi mode (#22103) Expands #18715 Release Notes: - Added arrow keys movement to the built-in terminal's [vi mode](https://github.com/alacritty/alacritty/blob/master/docs/features.md#vi-mode) (which is using Alacritty under the hood). Details -- A minuscule improvement on #18715 to allow user with alternative keyboard layouts to use the terminal's vi mode with the arrow keys. --- crates/terminal/src/terminal.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index 8f1afad3d5..6a33ecb838 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -1183,10 +1183,10 @@ impl Terminal { } let motion: Option = match key.as_str() { - "h" => Some(ViMotion::Left), - "j" => Some(ViMotion::Down), - "k" => Some(ViMotion::Up), - "l" => Some(ViMotion::Right), + "h" | "left" => Some(ViMotion::Left), + "j" | "down" => Some(ViMotion::Down), + "k" | "up" => Some(ViMotion::Up), + "l" | "right" => Some(ViMotion::Right), "w" => Some(ViMotion::WordRight), "b" if !keystroke.modifiers.control => Some(ViMotion::WordLeft), "e" => Some(ViMotion::WordRightEnd),