Skip to content

Commit

Permalink
Adjust editor: open excerpts split key binding (zed-industries#23646)
Browse files Browse the repository at this point in the history
The pattern in Zed and in other editors is to use `cmd` to modify some
file-opening action to open it in a split rather than in the current
pane.

- In the project pane, a `click` opens a file, and a `cmd-click` opens
it in a split
- In the file finder, `enter` opens the file, and a `cmd-enter` opens it
in a split

It makes sense to me that if `alt-enter` opens a file from the excerpt,
that `cmd-alt-enter` opens it in a split, following the pattern above.

Note: I'm not auto-merging this, as others might disagree.
Note: I didn't touch the Vim binding.

Release Notes:

- Breaking Change: Changed `editor: open excerpts split` key binding to
`cmd-alt-enter` on macOS and `ctrl-alt-enter` on Linux.
  • Loading branch information
JosephTLyons authored Jan 25, 2025
1 parent da2bd4b commit 21b4a0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/keymaps/default-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
"bindings": {
"alt-enter": "editor::OpenExcerpts",
"shift-enter": "editor::ExpandExcerpts",
"ctrl-k enter": "editor::OpenExcerptsSplit",
"ctrl-alt-enter": "editor::OpenExcerptsSplit",
"ctrl-shift-e": "pane::RevealInProjectPanel",
"ctrl-f8": "editor::GoToHunk",
"ctrl-shift-f8": "editor::GoToPrevHunk",
Expand Down Expand Up @@ -646,7 +646,7 @@
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev",
"alt-enter": "editor::OpenExcerpts",
"ctrl-k enter": "editor::OpenExcerptsSplit"
"ctrl-alt-enter": "editor::OpenExcerptsSplit"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions assets/keymaps/default-macos.json
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@
"bindings": {
"alt-enter": "editor::OpenExcerpts",
"shift-enter": "editor::ExpandExcerpts",
"cmd-k enter": "editor::OpenExcerptsSplit",
"cmd-alt-enter": "editor::OpenExcerptsSplit",
"cmd-shift-e": "pane::RevealInProjectPanel",
"cmd-f8": "editor::GoToHunk",
"cmd-shift-f8": "editor::GoToPrevHunk",
Expand Down Expand Up @@ -669,7 +669,7 @@
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev",
"alt-enter": "editor::OpenExcerpts",
"cmd-k enter": "editor::OpenExcerptsSplit"
"cmd-alt-enter": "editor::OpenExcerptsSplit"
}
},
{
Expand Down

0 comments on commit 21b4a0d

Please sign in to comment.