Closed ExploHash closed 2 months ago
I can reproduce.
"cmd-\\": null
it still triggers pane::SplitRight
(incorrectly)"cmd-\\": "zed::NoAction"
it still trigger pane::SplitRight
(incorrectly)"cmd-\\": "workspace::NewFile"
) it triggers the new action and does not split panes (correct).As cmd-\\
is only mapped in one place in the default MacOS keybinding:
https://github.com/zed-industries/zed/blob/910dbe9ce6c8e1441ca0822aacc5394a34143062/assets/keymaps/default-macos.json#L349
This is the only context you should need to remap:
{
"context": "Editor",
"bindings": {
"cmd-\\": null
}
},
But that's not working. Thanks for reporting.
@notpeter Thanks for checking :), good to hear that I didn't do anything stupid
because "ctrl-\" also register into macos system menus, link here which you cannot remap this actions.
Thanks @CharlesChen0823 that it. Because we include the cmd-\
in the menu, MacOS captures it. If you would like to unmap cmd-\
you will need this:
{
"context": "Editor",
"bindings": {
"cmd-\\": null
}
},
And you will need to assign an alternate shortcut under System Preferences -> Keyboard -> Keyboard Shortcuts -> App Shortcuts for Split Right
for Zed.
Then your View->Editor Layout menu will change from this to this:
And cmd-\
will truly be a no-op.
@ExploHash Please let me know if this works for you.
Ahh I see, thanks! It works kind of, the reason why I asked this is because I created a custom shortcut on CMD+\ in settings (to open a terminal). After remapping split right, now nothing happens at all even though in other applications CMD+\ does trigger my custom shortcut.
But it's fine I could just choose another keybinding even though it's interesting that it now doesn't trigger anything haha
Once you've gotten MacOS out of the way, instead of setting it to null, rebind it to whatever action you want. For example, this works for me:
{
"bindings": {
"cmd-\\": "terminal_panel::ToggleFocus"
}
},
@notpeter Its a shortcut in macos, so I kinda want Zed not to do anything with cmd + \ at alll
Check for existing issues
Describe the bug / provide steps to reproduce it
Set the keymap.json to
And do CMD+\ and see a pane still splits which is the default keybinding
Environment
Zed: v0.148.0 (Zed Preview) OS: macOS 14.5.0 Memory: 16 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
No logging happens