zed icon indicating copy to clipboard operation
zed copied to clipboard

editor: Add MoveUpByLines and MoveDownByLines actions

Open mrnugget opened this issue 1 year ago • 4 comments

This adds four new actions:

  • editor::MoveUpByLines
  • editor::MoveDownByLines
  • editor::SelectUpByLines (bound by default to shift-alt-up)
  • editor::SelectDownByLines (bound by default to shift-alt-up)

They all take a count by which to move the cursor up and down.

Requested by Adam here: https://twitter.com/adamwathan/status/1753017094248018302

Release Notes:

  • Added four new actions: editor::MoveUpByLines, editor::MoveDownByLines, editor::SelectUpByLines (bound by default to shift-alt-up with 3 lines), editor::SelectDownByLines (bound by default to shift-alt-up with 3 lines) that move the cursor up by the configured line count.

Demo

https://github.com/zed-industries/zed/assets/1185253/e78d4077-5bd5-4d72-a806-67695698af5d

https://github.com/zed-industries/zed/assets/1185253/0b086ec9-eb90-40a2-9009-844a215e6378

mrnugget avatar Feb 01 '24 12:02 mrnugget

very nice

bdsqqq avatar Feb 01 '24 12:02 bdsqqq

Added two new actions: editor::MoveUpByLines and editor::MoveDownByLines that move the cursor up by the configured line count. Default binding is alt-up and alt-down with 3 lines.

Don’t we already have actions bound to alt-up and alt-down?

I have them bound to moving single lines up and down, but I think by default they’re bound to Tree-sitter syntax selections.

maxdeviant avatar Feb 01 '24 13:02 maxdeviant

Don’t we already have actions bound to alt-up and alt-down?

Yup, sorry! Forgot to update that part of the PR description. I changed it in the code. Will fix PR description now.

mrnugget avatar Feb 01 '24 14:02 mrnugget

@maxbrunsfeld what do you think about this?

mrnugget avatar Feb 01 '24 17:02 mrnugget