# Add optional relative line jumps to go-to-line action \(\#46932\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e64985e5162339a0b4000fb3708b212592ae6eb3

Requested commit: e64985e5162339a0b4000fb3708b212592ae6eb3

Commit: e64985e5162339a0b4000fb3708b212592ae6eb3

Tree: fd33c9de5dad4d2e45a191d2ce7394c2c5a9e4b1

Author: Kalaay

Committer: GitHub

## Message

```
Add optional relative line jumps to go-to-line action (#46932)

Implements relative line jumping, a common feature i missed from
Vim/Neovim where you can jump to lines relative to your current cursor
position.

- New `{"relative": true}` flag for `go_to_line::Toggle` action 
- Supports both `-5` (5 lines up) and `b5` (backward 5 lines) syntax
- Full lines only (no column support in relative mode, wasnt sure if
that would be necessary)
- Unbound by default - users can add e.g. `"ctrl-j":
["go_to_line::Toggle", {"relative": true}]` to their keymap

Example usage:
- `5` → jump 5 lines down
- `-3` or `b3` → jump 3 lines up  
- `0` → stay on current line


[Screencast_20260115_191312.webm](https://github.com/user-attachments/assets/395c0e7b-8ac1-48c8-a39e-5ade4f9206ec)

Release Notes:

- Added relative line jump support to go-to-line action via
`+/-/f/b/F/B`
```

## Parents

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

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