# editor: Add MoveUpByLines and MoveDownByLines actions \(\#7208\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/11bd28870aa41876eea178e9d65ffd3df1f0ad6d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 11bd28870aa41876eea178e9d65ffd3df1f0ad6d

Requested commit: 11bd28870aa41876eea178e9d65ffd3df1f0ad6d

Commit: 11bd28870aa41876eea178e9d65ffd3df1f0ad6d

Tree: 403a5cf2d0ee27bf5263d76d38e65573e9cc57da

Author: Thorsten Ball

Committer: GitHub

## Message

````
editor: Add MoveUpByLines and MoveDownByLines actions (#7208)

This adds four new actions:

- `editor::MoveUpByLines`
- `editor::MoveDownByLines`
- `editor::SelectUpByLines`
- `editor::SelectDownByLines`

They all take a count by which to move the cursor up and down.
(Requested by Adam here:
https://twitter.com/adamwathan/status/1753017094248018302)


Example `keymap.json` entries:

```json
{
  "context": "Editor",
  "bindings": [
    "alt-up":         [ "editor::MoveUpByLines",     { "lines": 3 } ],
    "alt-down":       [ "editor::MoveDownByLines",   { "lines": 3 } ],
    "alt-shift-up":   [ "editor::SelectUpByLines",   { "lines": 3 } ],
    "alt-shift-down": [ "editor::SelectDownByLines", { "lines": 3 } ]
  ]
}
```

They are *not* bound by default, so as to not conflict with the
`alt-up/down` bindings that already exist.

Release Notes:

- Added four new actions: `editor::MoveUpByLines`,
`editor::MoveDownByLines`, `editor::SelectUpByLines`,
`editor::SelectDownByLines` that can take a line count configuration and
move the cursor up by the 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
````

## Parents

- [01ddf840f5516d90980288c24abb8b3e6e445744](https://git.cafe/gitcafe/zed/commit/01ddf840f5516d90980288c24abb8b3e6e445744?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/11bd28870aa41876eea178e9d65ffd3df1f0ad6d?format=markdown)
