We are making multiple changes to how keyboards work in Zed.
The first two affect all platforms, the remaining three affect only macOS.
For the thinking behind this, please see Zed Blog: macOS Keyboard Shortcut Localization.
1. Removal of alt- only key bindings.
As of Zed v0.162.x (released as Zed Preview on 2024-11-13 and Zed Stable on 2024-11-20) Zed will be removing a number of keyboard shortcuts which of the form alt-N / option-N where N is a single letter.
The purpose of this change is to better accommodate users of non-US keyboards in the default Zed configuration. On these keyboards, these default shortcuts prevented the use of non-ASCII characters required for these languages.
If you wish to continue using these, you will need to explicitly add them to your User keymap (~/.config/zed/keymap.json) which is accessible via the zed: open keymap action from the command palette or by pressing cmd-k cmd-s (Mac) or ctrl-k ctrl-s (Linux/Win).
[
{
"context": "Editor",
"bindings": {
"alt-b": "editor::MoveToPreviousWordStart",
"alt-d": "editor::DeleteToNextWordEnd",
"alt-f": "editor::MoveToNextWordEnd",
"alt-h": "editor::DeleteToPreviousWordStart",
"alt-q": "editor::Rewrap",
"alt-v": ["editor::MovePageUp", { "center_cursor": true }]
}
},
{
"context": "Editor && mode == full",
"bindings": {
"alt-z": "editor::ToggleSoftWrap"
}
},
{
"context": "AssistantPanel",
"bindings": {
"alt-m": "assistant::ToggleModelSelector"
}
}
]
We appreciate your understanding an apologize for any disruption this may cause.
2. Inline Completion (Copilot, SuperMaven) Partial Completion Acceptance
On MacOS, the default keyboard shortcut bound to editor::AcceptPartialInlineCompletion
will now be ctrl-right instead of cmd-right.
On Linux, the default keyboard shortcut bound to editor::AcceptPartialInlineCompletion
will now be alt-right instead of ctrl-right.
3. Updated shortcuts for extended Latin keyboards
On macOS when using a keyboard that supports an extended Latin character set (e.g. French, German, ...) keyboard shortcuts are now automatically updated so that they can be typed without option. This fixes several long-standing problems where some keyboards could not type some shortcuts.
This mapping works the same way as macOS. For example on a German keyboard shortcuts like cmd-> become cmd-:, cmd-[ and cmd-] become cmd-ö and cmd-ä. This mapping happens at the time keyboard layout files are read so the new keybindings are visible in the command palette by searching for an action. To opt out of this behavior for your custom keyboard shortcuts, set "use_layout_keys": true in your binding section. For the keys affected on each layout see here.
This does not affect Vim mode, as Vim's shortcuts use layout keys to make them more compatible with Vim.
4. Updated shortcut handling for non-Latin keyboards
On macOS when using a keyboard that types a non-Latin character set (e.g. Armenian, Cyrillic), bindings bound to latin characters are more reliable. Zed will now always try to use the character from your keyboard's command layout (which is usually QWERTY) when matching bindings, instead of only doing this when the command key is held down.
This allows you to use Vim's normal mode without switching keyboard, and makes bindings like ctrl-a for select all accessible.
5. Dispatching shortcuts before IME
Keyboard shortcuts will now be dispatched before trigging the IME system. This primarily affects vim mode on keyboards with IME menus (like Japanese), where you'll now be able to use vim normal mode without switching input.
It also changes the behavior on Extended Latin keyboards with dead keys. For example ^ will go to the beginning of a line in vim mode, even if it would normally be a dead key. This is a departure from vim, where you would have to type ^ space. Note that some mappings still require the space. For example: d f ^ space is needed because you might want to do d f â instead.
We are making multiple changes to how keyboards work in Zed.
The first two affect all platforms, the remaining three affect only macOS.
For the thinking behind this, please see Zed Blog: macOS Keyboard Shortcut Localization.
1. Removal of alt- only key bindings.
As of Zed v0.162.x (released as Zed Preview on 2024-11-13 and Zed Stable on 2024-11-20) Zed will be removing a number of keyboard shortcuts which of the form
alt-N/option-Nwhere N is a single letter.The purpose of this change is to better accommodate users of non-US keyboards in the default Zed configuration. On these keyboards, these default shortcuts prevented the use of non-ASCII characters required for these languages.
If you wish to continue using these, you will need to explicitly add them to your User keymap (
~/.config/zed/keymap.json) which is accessible via thezed: open keymapaction from the command palette or by pressingcmd-k cmd-s(Mac) orctrl-k ctrl-s(Linux/Win).We appreciate your understanding an apologize for any disruption this may cause.
2. Inline Completion (Copilot, SuperMaven) Partial Completion Acceptance
On MacOS, the default keyboard shortcut bound to
editor::AcceptPartialInlineCompletionwill now be
ctrl-rightinstead ofcmd-right.On Linux, the default keyboard shortcut bound to
editor::AcceptPartialInlineCompletionwill now be
alt-rightinstead ofctrl-right.editor::AcceptPartialInlineCompletionaction #204193. Updated shortcuts for extended Latin keyboards
On macOS when using a keyboard that supports an extended Latin character set (e.g. French, German, ...) keyboard shortcuts are now automatically updated so that they can be typed without option. This fixes several long-standing problems where some keyboards could not type some shortcuts.
This mapping works the same way as macOS. For example on a German keyboard shortcuts like
cmd->becomecmd-:,cmd-[andcmd-]becomecmd-öandcmd-ä. This mapping happens at the time keyboard layout files are read so the new keybindings are visible in the command palette by searching for an action. To opt out of this behavior for your custom keyboard shortcuts, set "use_layout_keys": true in your binding section. For the keys affected on each layout see here.This does not affect Vim mode, as Vim's shortcuts use layout keys to make them more compatible with Vim.
4. Updated shortcut handling for non-Latin keyboards
On macOS when using a keyboard that types a non-Latin character set (e.g. Armenian, Cyrillic), bindings bound to latin characters are more reliable. Zed will now always try to use the character from your keyboard's command layout (which is usually QWERTY) when matching bindings, instead of only doing this when the
commandkey is held down.This allows you to use Vim's normal mode without switching keyboard, and makes bindings like
ctrl-afor select all accessible.5. Dispatching shortcuts before IME
Keyboard shortcuts will now be dispatched before trigging the IME system. This primarily affects vim mode on keyboards with IME menus (like Japanese), where you'll now be able to use vim normal mode without switching input.
It also changes the behavior on Extended Latin keyboards with dead keys. For example ^ will go to the beginning of a line in vim mode, even if it would normally be a dead key. This is a departure from vim, where you would have to type
^ space. Note that some mappings still require the space. For example:d f ^ spaceis needed because you might want to dod f âinstead.