From a1d4bd94c947af4970a6ca977e4fdd6d358c07bb Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Tue, 11 Feb 2025 01:34:32 -0700 Subject: [PATCH] Make `alt-l` the default linux/windows binding for AcceptEditPrediction (#24630) Release Notes: - N/A --- assets/keymaps/default-linux.json | 10 ++++++++-- assets/keymaps/vim.json | 11 +++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index 74c086f8cad87306e8d5f336a58f21c75b70a782..243f5f9d4f3bb4be0d05add09190bfeeb29cad07 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -502,16 +502,22 @@ "tab": "editor::ComposeCompletion" } }, + // Bindings for accepting edit predictions + // + // alt-l is provided as an alternative to tab/alt-tab. and will be displayed in the UI. This is + // because alt-tab may not be available, as it is often used for window switching. { "context": "Editor && edit_prediction", "bindings": { - "alt-enter": "editor::AcceptEditPrediction" + "alt-tab": "editor::AcceptEditPrediction", + "alt-l": "editor::AcceptEditPrediction" } }, { "context": "Editor && edit_prediction && !edit_prediction_requires_modifier", "bindings": { - "tab": "editor::AcceptEditPrediction" + "tab": "editor::AcceptEditPrediction", + "alt-l": "editor::AcceptEditPrediction" } }, { diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json index 7e202c2448b91468ed500061bba0e51328c20d96..111d4c8181f111dca294f2d7dc1eeccab9f1373e 100644 --- a/assets/keymaps/vim.json +++ b/assets/keymaps/vim.json @@ -698,7 +698,18 @@ { "context": "edit_prediction && !edit_prediction_requires_modifier", "bindings": { + // This is identical to the binding in the base keymap, but the vim bindings above to + // "vim::Tab" shadow it, so it needs to be bound again. "tab": "editor::AcceptEditPrediction" } + }, + { + "context": "os != macos && edit_prediction", + "bindings": { + // alt-l is provided as an alternative to tab/alt-tab. and will be displayed in the UI. This + // is because alt-tab may not be available, as it is often used for window switching on Linux + // and Windows. + "alt-l": "editor::AcceptEditPrediction" + } } ]