zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.9k stars 2.69k forks source link

Example on docs site breaks vim mode #14663

Closed ceuk closed 1 week ago

ceuk commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

There's an example of how to enable sub-word jumping on the site:

  {
    "context": "VimControl && !menu",
    "bindings": {
      "w": "vim::NextSubwordStart",
      "b": "vim::PreviousSubwordStart",
      "e": "vim::NextSubwordEnd",
      "g e": "vim::PreviousSubwordEnd"
    }
  },

However, when this is added, various vim motions cease to work (e.g. interacting with text objects with motions such as caw)

Environment

Arch Linux

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 response

mrnugget commented 1 month ago

Can you try this?

[
  {
    "context": "VimControl && !menu && vim_mode != operator",
    "bindings": {
      "w": "vim::NextSubwordStart",
      "b": "vim::PreviousSubwordStart",
      "e": "vim::NextSubwordEnd",
      "g e": "vim::PreviousSubwordEnd"
    }
  }
]

I think that fixes it.

NathanLovato commented 2 weeks ago

This issue can be closed; it's been resolved, the docs now list the example of mrnugget, and it does preserve text object operations like caw.