zed icon indicating copy to clipboard operation
zed copied to clipboard

Keybinding CMD+K not working

Open garrettg123 opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

keymap.json

// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
  {
    "context": "Workspace",
    "bindings": {
      // "shift shift": "file_finder::Toggle"
    }
  },
  {
    "context": "Editor",
    "bindings": {
      // "j k": ["workspace::SendKeystrokes", "escape"]
      "cmd-k n": ["editor::GoToDiagnostic"]
    }
  }
]

Environment

Zed: v0.149.5 (Zed) OS: macOS 14.5.0 Memory: 32 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.

Zed.log

garrettg123 avatar Aug 23 '24 16:08 garrettg123

That keybinding works for me. Did you perhaps want diagnostics::Deploy (toggles focus to the Diagnostics panel)?

editor::GoToDiagnostic (goes to the next diagnostic error/warning in the current file, pairs with editor::GoToPrevDiagnostic to go to the previous)?

notpeter avatar Aug 23 '24 17:08 notpeter

No, I mean the key binding doesn't do anything, regardless of what I make the action. Maybe I'm putting in the wrong syntax for cmd or maybe these are silently failing?

// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
  {
    "context": "Workspace",
    "bindings": {
      // "shift shift": "file_finder::Toggle"
    }
  },
  {
    "context": "Editor",
    "bindings": {
      // "j k": ["workspace::SendKeystrokes", "escape"]
      "cmd-k n": ["editor::GoToDiagnostic"],
      "ctrl-cmd-w": ["pane::CloseInactiveItems"],
      "cmd-@": ["editor::FindAllReferences"]
    }
  }
]

garrettg123 avatar Aug 26 '24 17:08 garrettg123

// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
    {
        "context": "Workspace",
        "bindings": {
            // "shift shift": "file_finder::Toggle"
        }
    },
    {
        "context": "Editor",
        "bindings": {
            // "j k": ["workspace::SendKeystrokes", "escape"]
            "cmd-k n": "editor::GoToDiagnostic",
            "ctrl-cmd-w": "pane::CloseInactiveItems",
            "cmd-@": "editor::FindAllReferences"
        }
    }
]

Use this and it will work. I've tested all 3 bindings for Editor and they all work.

devzeth avatar Feb 19 '25 21:02 devzeth