Skip to content

Wrong key binding information with base_keymap set #32952

Open
@fornellas

Description

@fornellas

Summary

Some key bindings seem to be shown by the UI unconditionally for the default values, ignoring any overrides that base_keymap may have done, thus misleading users into using key combinations that don't work.

keymap.json
settings.json

Description

Image

Steps to reproduce:

  1. Set "base_keymap": "SublimeText".
  2. Focus some open buffer.
  3. Hover over "Project Diagnostics": it'll show the key binding being Ctrl-Shift-M.
  4. Press Ctrl-Shift-M (nothing happens).
  5. Unset "base_keymap": "SublimeText".
  6. Press Ctrl-Shift-M, it now opens the diagnostics.

Expected Behavior: For the shown key binding that reflect what'll actually work / not work.
Actual Behavior: The UI show values for default bindings, ignoring what base_keymap sets.

The default value for Ctrl-Shift-M seems to be set here for the Workspace context, while SublimeText seems to redefine it here. Trying to set this at keymap.json does not seem to work:

[
  {
    "context": "Workspace",
    "bindings": {
      "ctrl-shift-m": null
    }
  }
]

The only "fix" is to do this instead:

[
  {
    "context": "Editor",
    "bindings": {
      "ctrl-shift-m": "diagnostics::Deploy"
    }
  }
]

Another example of this is "editor: go to type definition Ctrl-F12": with base_keymap unset, it works, with "base_keymap": "SublimeText" Ctrl-F12 seems to actually do "editor: go to type definition split Ctrl-Alt-F12".

Image

Zed Version and System Specs

Zed: v0.190.6 (Zed)
OS: Linux Wayland ubuntu 25.04
Memory: 31.2 GiB
Architecture: x86_64
GPU: AMD Radeon RX 7800 XT (RADV NAVI32) || radv || Mesa 25.0.3-1ubuntu2

Metadata

Metadata

Assignees

No one assigned

    Labels

    keybindsKeyboard shortcuts, mapping, binding, keymaps, etc

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions