mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -07:00
feat(cli): add Alt+D for forward word deletion (#19300)
This commit is contained in:
committed by
GitHub
parent
65e0043fbf
commit
5f6b7c0158
@@ -36,7 +36,7 @@ available combinations.
|
|||||||
| Delete from the cursor to the start of the line. | `Ctrl + U` |
|
| Delete from the cursor to the start of the line. | `Ctrl + U` |
|
||||||
| Clear all text in the input field. | `Ctrl + C` |
|
| Clear all text in the input field. | `Ctrl + C` |
|
||||||
| Delete the previous word. | `Ctrl + Backspace`<br />`Alt + Backspace`<br />`Ctrl + W` |
|
| Delete the previous word. | `Ctrl + Backspace`<br />`Alt + Backspace`<br />`Ctrl + W` |
|
||||||
| Delete the next word. | `Ctrl + Delete`<br />`Alt + Delete` |
|
| Delete the next word. | `Ctrl + Delete`<br />`Alt + Delete`<br />`Alt + D` |
|
||||||
| Delete the character to the left. | `Backspace`<br />`Ctrl + H` |
|
| Delete the character to the left. | `Backspace`<br />`Ctrl + H` |
|
||||||
| Delete the character to the right. | `Delete`<br />`Ctrl + D` |
|
| Delete the character to the right. | `Delete`<br />`Ctrl + D` |
|
||||||
| Undo the most recent text edit. | `Cmd + Z (no Shift)`<br />`Alt + Z (no Shift)` |
|
| Undo the most recent text edit. | `Cmd + Z (no Shift)`<br />`Alt + Z (no Shift)` |
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ export const defaultKeyBindings: KeyBindingConfig = {
|
|||||||
[Command.DELETE_WORD_FORWARD]: [
|
[Command.DELETE_WORD_FORWARD]: [
|
||||||
{ key: 'delete', ctrl: true },
|
{ key: 'delete', ctrl: true },
|
||||||
{ key: 'delete', alt: true },
|
{ key: 'delete', alt: true },
|
||||||
|
{ key: 'd', alt: true },
|
||||||
],
|
],
|
||||||
[Command.DELETE_CHAR_LEFT]: [{ key: 'backspace' }, { key: 'h', ctrl: true }],
|
[Command.DELETE_CHAR_LEFT]: [{ key: 'backspace' }, { key: 'h', ctrl: true }],
|
||||||
[Command.DELETE_CHAR_RIGHT]: [{ key: 'delete' }, { key: 'd', ctrl: true }],
|
[Command.DELETE_CHAR_RIGHT]: [{ key: 'delete' }, { key: 'd', ctrl: true }],
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ const MAC_ALT_KEY_CHARACTER_MAP: Record<string, string> = {
|
|||||||
'\u00B5': 'm', // "µ" toggle markup view
|
'\u00B5': 'm', // "µ" toggle markup view
|
||||||
'\u03A9': 'z', // "Ω" Option+z
|
'\u03A9': 'z', // "Ω" Option+z
|
||||||
'\u00B8': 'Z', // "¸" Option+Shift+z
|
'\u00B8': 'Z', // "¸" Option+Shift+z
|
||||||
|
'\u2202': 'd', // "∂" delete word forward
|
||||||
};
|
};
|
||||||
|
|
||||||
function nonKeyboardEventFilter(
|
function nonKeyboardEventFilter(
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ describe('keyMatchers', () => {
|
|||||||
positive: [
|
positive: [
|
||||||
createKey('delete', { ctrl: true }),
|
createKey('delete', { ctrl: true }),
|
||||||
createKey('delete', { alt: true }),
|
createKey('delete', { alt: true }),
|
||||||
|
createKey('d', { alt: true }),
|
||||||
],
|
],
|
||||||
negative: [createKey('delete'), createKey('backspace', { ctrl: true })],
|
negative: [createKey('delete'), createKey('backspace', { ctrl: true })],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user