# editor: Add rotation commands for selections and lines \(\#41236\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d5a437d22f4c7a981a5bb8baff3166d4b06846b2

Requested commit: d5a437d22f4c7a981a5bb8baff3166d4b06846b2

Commit: d5a437d22f4c7a981a5bb8baff3166d4b06846b2

Tree: 4aba295b90a6feef9610717fb63eb9f859615b16

Author: Pablo Aguiar

Committer: GitHub

## Message

```
editor: Add rotation commands for selections and lines (#41236)

Introduces RotateSelectionsForward and RotateSelectionsBackward actions
that rotate content in a circular fashion across multiple cursors.

Behavior based on context:
- With selections: rotates the selected text at each cursor position
(e.g., x=1, y=2, z=3 becomes x=3, y=1, z=2)
- With just cursors: rotates entire lines at cursor positions (e.g.,
three lines cycle to line3, line1, line2)

Selections are preserved after rotation, allowing repeated cycling.
Useful for quickly rearranging values, lines, or arguments.

For more examples and use cases, please refer to #5315.

I'm eager to read your thoughts and make any adjustments or improvements
to any aspect of this change.

Closes #5315

Release Notes:

- Added `RotateSelectionsForward` and `RotateSelectionsBackward` actions
that rotate content in a circular fashion across multiple cursors
```

## Parents

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

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