cleanup: Improve keybindings (#16672)

This commit is contained in:
Tommaso Sciortino
2026-01-14 16:30:07 -08:00
committed by GitHub
parent e58fca68ce
commit 42c26d1e1b
5 changed files with 17 additions and 23 deletions

View File

@@ -66,6 +66,8 @@ export enum Command {
TOGGLE_AUTO_EDIT = 'toggleAutoEdit',
UNDO = 'undo',
REDO = 'redo',
MOVE_UP = 'moveUp',
MOVE_DOWN = 'moveDown',
MOVE_LEFT = 'moveLeft',
MOVE_RIGHT = 'moveRight',
MOVE_WORD_LEFT = 'moveWordLeft',
@@ -141,6 +143,8 @@ export const defaultKeyBindings: KeyBindingConfig = {
{ key: 'right', ctrl: false, command: false },
{ key: 'f', ctrl: true },
],
[Command.MOVE_UP]: [{ key: 'up', ctrl: false, command: false }],
[Command.MOVE_DOWN]: [{ key: 'down', ctrl: false, command: false }],
[Command.MOVE_WORD_LEFT]: [
{ key: 'left', ctrl: true },
{ key: 'left', command: true },
@@ -269,6 +273,8 @@ export const commandCategories: readonly CommandCategory[] = [
commands: [
Command.HOME,
Command.END,
Command.MOVE_UP,
Command.MOVE_DOWN,
Command.MOVE_LEFT,
Command.MOVE_RIGHT,
Command.MOVE_WORD_LEFT,
@@ -372,6 +378,8 @@ export const commandDescriptions: Readonly<Record<Command, string>> = {
[Command.END]: 'Move the cursor to the end of the line.',
[Command.MOVE_LEFT]: 'Move the cursor one character to the left.',
[Command.MOVE_RIGHT]: 'Move the cursor one character to the right.',
[Command.MOVE_UP]: 'Move the cursor up one line.',
[Command.MOVE_DOWN]: 'Move the cursor down one line.',
[Command.MOVE_WORD_LEFT]: 'Move the cursor one word to the left.',
[Command.MOVE_WORD_RIGHT]: 'Move the cursor one word to the right.',
[Command.KILL_LINE_RIGHT]: 'Delete from the cursor to the end of the line.',