From 9e9dc45ac9eb48027eaf58bbf49adf7619d28b2e Mon Sep 17 00:00:00 2001 From: Chenguang Wang Date: Sun, 4 Jun 2023 21:01:19 -0700 Subject: [PATCH] support Emacs-style backward word deletion with Ctrl-Alt-b --- PSReadLine/KeyBindings.cs | 1 + PSReadLine/Keys.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/PSReadLine/KeyBindings.cs b/PSReadLine/KeyBindings.cs index 89564228d..26b111f39 100644 --- a/PSReadLine/KeyBindings.cs +++ b/PSReadLine/KeyBindings.cs @@ -330,6 +330,7 @@ void SetDefaultEmacsBindings() { Keys.AltR, MakeKeyHandler(RevertLine, "RevertLine") }, { Keys.AltY, MakeKeyHandler(YankPop, "YankPop") }, { Keys.AltBackspace, MakeKeyHandler(BackwardKillWord, "BackwardKillWord") }, + { Keys.CtrlAltH, MakeKeyHandler(BackwardKillWord, "BackwardKillWord") }, { Keys.AltEquals, MakeKeyHandler(PossibleCompletions, "PossibleCompletions") }, { Keys.CtrlAltQuestion, MakeKeyHandler(ShowKeyBindings, "ShowKeyBindings") }, { Keys.AltQuestion, MakeKeyHandler(WhatIsKey, "WhatIsKey") }, diff --git a/PSReadLine/Keys.cs b/PSReadLine/Keys.cs index 4a621bb2a..c70227436 100644 --- a/PSReadLine/Keys.cs +++ b/PSReadLine/Keys.cs @@ -605,6 +605,7 @@ internal static class Keys public static PSKeyInfo CtrlShiftLeftArrow = CtrlShift(ConsoleKey.LeftArrow); public static PSKeyInfo CtrlShiftRightArrow = CtrlShift(ConsoleKey.RightArrow); + public static PSKeyInfo CtrlAltH = CtrlAlt('h'); public static PSKeyInfo CtrlAltY = CtrlAlt('y'); public static PSKeyInfo CtrlAltRBracket = CtrlAlt(']'); public static PSKeyInfo CtrlAltQuestion = CtrlAlt('?');