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.62k stars 2.64k forks source link

custom keybinding for vim cannot be executed n times #14921

Open F8RZD opened 1 month ago

F8RZD commented 1 month ago

Check for existing issues

Describe the feature

I use vim mode and have the below keybinding

[
  {
    "context": "vim_mode == visual",
    "bindings": {
      "shift-j": "editor::MoveLineDown",
      "shift-k": "editor::MoveLineUp"
    }
  }
]

this lets me to use shift-j and shift-k to move lines of code up and down

but if I want to move them 3 lines up I would expect to use 3shift-k but it only moves 1 position

expected behavior:

selected lines 3 positions up

F8RZD commented 1 month ago

I have also remapped "J" instead of "shift-j"

and nothing changed

ConradIrwin commented 1 month ago

@F8RZD Unfortunately the editor:: commands are not vim count aware (and neither is workspace::SendKeystrokes).

Not clear the right way to fix it, but it would be nice to make it work.

F8RZD commented 1 month ago

It's implementation would be a great enhancement to vim mode