From cffb883108ec07ec2f51446cb35eac19b89e625f Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Tue, 9 Sep 2025 16:07:42 -0400 Subject: [PATCH] Consistently map syntax node navigation actions on macOS (#37874) Skipping Linux and Windows keymaps here, as it's hard to find a consistent base-binding for all 4 actions across all platforms that don't break important actions for each keymap. Someone else can think on that and make a proposal. Release Notes: - Added bindings for navigating between sibling nodes in the syntax tree on macOS (`cmd-ctrl-{up/down}` for `SelectPreviousSyntaxNode` and `SelectNextSyntaxNode`). Breaking change: the existing syntax tree parent/child navigation bindings have moved from `ctrl-shift-{left/right}` to `cmd-ctrl-{left/right}` to create a unified four-directional navigation pattern where all syntax tree operations use the same modifier combination. We could not use the previous base modifiers without breaking more bindings. --- assets/keymaps/default-linux.json | 4 ++-- assets/keymaps/default-macos.json | 6 ++++-- assets/keymaps/default-windows.json | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index 7c7692ac46f5d680207df43483a067373341433c..6ad2244fa8a4a17d37d76831ec16ef68df8aaf60 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -493,8 +493,8 @@ "alt-down": "editor::MoveLineDown", "ctrl-alt-shift-up": "editor::DuplicateLineUp", "ctrl-alt-shift-down": "editor::DuplicateLineDown", - "alt-shift-right": "editor::SelectLargerSyntaxNode", // Expand Selection - "alt-shift-left": "editor::SelectSmallerSyntaxNode", // Shrink Selection + "alt-shift-right": "editor::SelectLargerSyntaxNode", // Expand selection + "alt-shift-left": "editor::SelectSmallerSyntaxNode", // Shrink selection "ctrl-shift-l": "editor::SelectAllMatches", // Select all occurrences of current selection "ctrl-f2": "editor::SelectAllMatches", // Select all occurrences of current word "ctrl-d": ["editor::SelectNext", { "replace_newest": false }], // editor.action.addSelectionToNextFindMatch / find_under_expand diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index 8cf1217fb06ef6e13b814b0c00c489ba39e3ca38..9f13fc30798db2dea34dfbf778a904b6c2301cb3 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -544,8 +544,10 @@ "alt-down": "editor::MoveLineDown", "alt-shift-up": "editor::DuplicateLineUp", "alt-shift-down": "editor::DuplicateLineDown", - "ctrl-shift-right": "editor::SelectLargerSyntaxNode", // Expand Selection - "ctrl-shift-left": "editor::SelectSmallerSyntaxNode", // Shrink Selection + "cmd-ctrl-left": "editor::SelectSmallerSyntaxNode", // Shrink selection + "cmd-ctrl-right": "editor::SelectLargerSyntaxNode", // Expand selection + "cmd-ctrl-up": "editor::SelectPreviousSyntaxNode", // Move selection up + "cmd-ctrl-down": "editor::SelectNextSyntaxNode", // Move selection down "cmd-d": ["editor::SelectNext", { "replace_newest": false }], // editor.action.addSelectionToNextFindMatch / find_under_expand "cmd-shift-l": "editor::SelectAllMatches", // Select all occurrences of current selection "cmd-f2": "editor::SelectAllMatches", // Select all occurrences of current word diff --git a/assets/keymaps/default-windows.json b/assets/keymaps/default-windows.json index b10ac964339efed3a3237af08e65f5d519dde8ce..9d040372c6e808d3de60a2035a561bc535785181 100644 --- a/assets/keymaps/default-windows.json +++ b/assets/keymaps/default-windows.json @@ -492,8 +492,8 @@ "alt-down": "editor::MoveLineDown", "shift-alt-up": "editor::DuplicateLineUp", "shift-alt-down": "editor::DuplicateLineDown", - "shift-alt-right": "editor::SelectLargerSyntaxNode", // Expand Selection - "shift-alt-left": "editor::SelectSmallerSyntaxNode", // Shrink Selection + "shift-alt-right": "editor::SelectLargerSyntaxNode", // Expand selection + "shift-alt-left": "editor::SelectSmallerSyntaxNode", // Shrink selection "ctrl-shift-l": "editor::SelectAllMatches", // Select all occurrences of current selection "ctrl-f2": "editor::SelectAllMatches", // Select all occurrences of current word "ctrl-d": ["editor::SelectNext", { "replace_newest": false }], // editor.action.addSelectionToNextFindMatch / find_under_expand